From 5f37d3fbc60989d0315cc7fb7b7e790cd53dc6c3 Mon Sep 17 00:00:00 2001 From: reimar Date: Sat, 3 Feb 2007 13:19:21 +0000 Subject: [PATCH] Avoid crash in uninit if codec not found git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22109 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpcodecs/vd_ffmpeg.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libmpcodecs/vd_ffmpeg.c b/libmpcodecs/vd_ffmpeg.c index 2b993c4a93..93ba5d660b 100644 --- a/libmpcodecs/vd_ffmpeg.c +++ b/libmpcodecs/vd_ffmpeg.c @@ -431,12 +431,14 @@ static void uninit(sh_video_t *sh){ ); } + 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);