mirror of https://github.com/mpv-player/mpv
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:
parent
4aedf31dc5
commit
5f37d3fbc6
|
@ -431,12 +431,14 @@ static void uninit(sh_video_t *sh){
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (avctx) {
|
||||||
if (avctx && avctx->codec && avcodec_close(avctx) < 0)
|
if (avctx && avctx->codec && avcodec_close(avctx) < 0)
|
||||||
mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantCloseCodec);
|
mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantCloseCodec);
|
||||||
|
|
||||||
av_freep(&avctx->extradata);
|
av_freep(&avctx->extradata);
|
||||||
av_freep(&avctx->palctrl);
|
av_freep(&avctx->palctrl);
|
||||||
av_freep(&avctx->slice_offset);
|
av_freep(&avctx->slice_offset);
|
||||||
|
}
|
||||||
|
|
||||||
av_freep(&avctx);
|
av_freep(&avctx);
|
||||||
av_freep(&ctx->pic);
|
av_freep(&ctx->pic);
|
||||||
|
|
Loading…
Reference in New Issue