aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-07-12 22:42:18 +0200
committerAnton Khirnov <anton@khirnov.net>2011-07-13 20:49:31 +0200
commit13551ad1e336573e3732fdeaf25607c47244bb80 (patch)
tree19a5d13a9804469a1b9c4897002ee2a2597666bd
parent575c38d76ce546842d62a481ef03c122d55d3a69 (diff)
downloadffmpeg-13551ad1e336573e3732fdeaf25607c47244bb80.tar.gz
lavf: fix segfault in av_open_input_stream()
ic is NULL in case of error.
-rw-r--r--libavformat/utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c
index e738dba44a..71fa95526c 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -466,7 +466,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;