diff options
author | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-23 21:39:16 +0400 |
---|---|---|
committer | Reimar Döffinger <Reimar.Doeffinger@gmx.de> | 2011-08-23 21:47:19 +0400 |
commit | 95345e942cd5b8be6722d48e3f17782e97d09bde (patch) | |
tree | 2c212bfae8ac4627b6a1e60829fb7a7f90e976a0 /libavformat/utils.c | |
parent | 87757508abe36dd376093c59f00db41fe15d76a5 (diff) |
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.c | 3 |
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 |