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>
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user