Avoid crash in uninit if codec not found

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@22109 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
reimar 2007-02-03 13:19:21 +00:00
parent 4aedf31dc5
commit 5f37d3fbc6
1 changed files with 2 additions and 0 deletions

View File

@ -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);