ffmpeg | branch: master | Pierre-Anthony Lemieux <[email protected]> | Mon Jan 
 3 07:59:19 2022 -0800| [59f1a46048109b8ec9f953d0d9348f9f1ae2a8c2] | committer: 
Zane van Iperen

avformat/imf: fix bad free() when directory name of the input url is empty

Signed-off-by: Pierre-Anthony Lemieux <[email protected]>
Signed-off-by: Zane van Iperen <[email protected]>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=59f1a46048109b8ec9f953d0d9348f9f1ae2a8c2
---

 libavformat/imfdec.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libavformat/imfdec.c b/libavformat/imfdec.c
index 503c8a2659..023f3556f6 100644
--- a/libavformat/imfdec.c
+++ b/libavformat/imfdec.c
@@ -624,8 +624,11 @@ static int imf_read_header(AVFormatContext *s)
     tmp_str = av_strdup(s->url);
     if (!tmp_str)
         return AVERROR(ENOMEM);
+    c->base_url = av_strdup(av_dirname(tmp_str));
+    av_freep(&tmp_str);
+    if (!c->base_url)
+        return AVERROR(ENOMEM);
 
-    c->base_url = av_dirname(tmp_str);
     if ((ret = ffio_copy_url_options(s->pb, &c->avio_opts)) < 0)
         return ret;
 

_______________________________________________
ffmpeg-cvslog mailing list
[email protected]
https://ffmpeg.org/mailman/listinfo/ffmpeg-cvslog

To unsubscribe, visit link above, or email
[email protected] with subject "unsubscribe".

Reply via email to