[PR] avformat/imfdec: check for a missing Path in the asset map (PR #23660)

michaelni via ffmpeg-devel <[email protected]>
Newsgroups gmane.comp.video.ffmpeg.devel
Message-ID <178284707437.59.934566255229547508@29965ddac10e>
PR #23660 opened by michaelni
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23660
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/23660.patch

Fixes: NULL pointer dereference
Fixes: vIIX7oqa3coO
Fixes: 73f6cce9361 (avformat/imf: Demuxer)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <[email protected]>



>From c27d49ae14235ea3a942313a6f541b70fc3ff226 Mon Sep 17 00:00:00 2001
From: Pavel Kohout <[email protected]>
Date: Tue, 30 Jun 2026 00:02:43 +0200
Subject: [PATCH] avformat/imfdec: check for a missing Path in the asset map

Fixes: NULL pointer dereference
Fixes: vIIX7oqa3coO
Fixes: 73f6cce9361 (avformat/imf: Demuxer)
Found-by: Pavel Kohout (Aisle Research)
Signed-off-by: Michael Niedermayer <[email protected]>
---
 libavformat/imfdec.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index def9b2b7a7..987304e5f5 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -255,7 +255,15 @@ static int parse_imf_asset_map_from_xml_dom(AVFormatContext *s,
             return AVERROR_INVALIDDATA;
         }
 
-        uri = xmlNodeGetContent(ff_imf_xml_get_child_element_by_name(node, "Path"));
+        if (!(node = ff_imf_xml_get_child_element_by_name(node, "Path"))) {
+            av_log(s, AV_LOG_ERROR, "Unable to parse asset map XML - missing Path node\n");
+            return AVERROR_INVALIDDATA;
+        }
+
+        uri = xmlNodeGetContent(node);
+        if (!uri)
+            return AVERROR(ENOMEM);
+
         if (!imf_uri_is_url(uri) && !imf_uri_is_unix_abs_path(uri) && !imf_uri_is_dos_abs_path(uri))
             asset->absolute_uri = av_append_path_component(base_url, uri);
         else
-- 
2.52.0

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.