# HG changeset patch # User reimar # Date 1170508761 0 # Node ID 035fd43fe5f1b92484c800c5cc191f3924f52690 # Parent 5d2eb1fb357995beeb871e500adcd6c1dcb0c209 Avoid crash in uninit if codec not found diff -r 5d2eb1fb3579 -r 035fd43fe5f1 libmpcodecs/vd_ffmpeg.c --- a/libmpcodecs/vd_ffmpeg.c Sat Feb 03 12:57:58 2007 +0000 +++ b/libmpcodecs/vd_ffmpeg.c Sat Feb 03 13:19:21 2007 +0000 @@ -431,12 +431,14 @@ ); } + if (avctx) { if (avctx && avctx->codec && avcodec_close(avctx) < 0) mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantCloseCodec); av_freep(&avctx->extradata); av_freep(&avctx->palctrl); av_freep(&avctx->slice_offset); + } av_freep(&avctx); av_freep(&ctx->pic);