[FFmpeg-cvslog] lavf: fix segfault in av_open_input_stream()

Anton Khirnov git at videolan.org
Sat Oct 1 22:47:26 CEST 2011


ffmpeg | branch: release/0.8 | Anton Khirnov <anton at khirnov.net> | Tue Jul 12 22:42:18 2011 +0200| [9c2a02466053dd4762d474d89d9be9a957eaaefe] | committer: Reinhard Tartler

lavf: fix segfault in av_open_input_stream()

ic is NULL in case of error.
(cherry picked from commit 13551ad1e336573e3732fdeaf25607c47244bb80)

Signed-off-by: Anton Khirnov <anton at khirnov.net>

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

 libavformat/utils.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/utils.c b/libavformat/utils.c
index 0e6b001..2cb096e 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -465,7 +465,8 @@ int av_open_input_stream(AVFormatContext **ic_ptr,
     else
         ic->pb = pb;
 
-    err = avformat_open_input(&ic, filename, fmt, &opts);
+    if ((err = avformat_open_input(&ic, filename, fmt, &opts)) < 0)
+        goto fail;
     ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above
 
     *ic_ptr = ic;



More information about the ffmpeg-cvslog mailing list