From 13551ad1e336573e3732fdeaf25607c47244bb80 Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Tue, 12 Jul 2011 22:42:18 +0200 Subject: lavf: fix segfault in av_open_input_stream() ic is NULL in case of error. --- libavformat/utils.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit v1.2.3