aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat/utils.c
diff options
context:
space:
mode:
authorReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-08-23 19:39:16 +0200
committerReimar Döffinger <Reimar.Doeffinger@gmx.de>2011-08-23 19:47:19 +0200
commit95345e942cd5b8be6722d48e3f17782e97d09bde (patch)
tree2c212bfae8ac4627b6a1e60829fb7a7f90e976a0 /libavformat/utils.c
parent87757508abe36dd376093c59f00db41fe15d76a5 (diff)
downloadffmpeg-95345e942cd5b8be6722d48e3f17782e97d09bde.tar.gz
Avoid crash due to ic being NULL if avformat_open_input fails.
This updates the code to match current master. Should fix trac issue #410. Signed-off-by: Reimar Döffinger <Reimar.Doeffinger@gmx.de>
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 3242887f41..662b49ae19 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -537,7 +537,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_ptr = ic;
ic->pb = ic->pb ? ic->pb : pb; // don't leak custom pb if it wasn't set above