== FFMPEG ==

Fixes: [#10703] loading an .avi captured by dosbox causes a segfault
We shouldn't try to close a codec, if we haven't managed to open one... :)
This commit is contained in:
Peter Schlaile 2008-05-05 22:08:50 +00:00
parent 1989e757b0
commit 2b1797d07b

@ -305,13 +305,11 @@ static int isffmpeg (char *filename) {
/* Find the decoder for the video stream */
pCodec=avcodec_find_decoder(pCodecCtx->codec_id);
if(pCodec==NULL) {
avcodec_close(pCodecCtx);
av_close_input_file(pFormatCtx);
return 0;
}
if(avcodec_open(pCodecCtx, pCodec)<0) {
avcodec_close(pCodecCtx);
av_close_input_file(pFormatCtx);
return 0;
}