summaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorAnton Khirnov <[email protected]>2011-07-12 22:42:18 +0200
committerReinhard Tartler <[email protected]>2011-09-26 19:26:29 +0200
commit9c2a02466053dd4762d474d89d9be9a957eaaefe (patch)
tree7329ffa7b841d47ba24247d8bd9e3d09cadd9aec /libavformat/utils.c
parentf8521560fa95c83bfbd95bb1b5adc8ded62a5104 (diff)
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 <[email protected]>
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r--libavformat/utils.c3
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;