diff options
author | Anton Khirnov <anton@khirnov.net> | 2011-07-12 22:42:18 +0200 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2011-09-11 12:34:05 +0200 |
commit | 44b3f053090bfb4bae50d3f92d4e70335066f91c (patch) | |
tree | 7329ffa7b841d47ba24247d8bd9e3d09cadd9aec | |
parent | dc3ab8ca438e7033cd7e049398f78d87d3b6fc55 (diff) | |
download | ffmpeg-44b3f053090bfb4bae50d3f92d4e70335066f91c.tar.gz |
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@khirnov.net>
-rw-r--r-- | libavformat/utils.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 0e6b00195b..2cb096e373 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; |