[MPlayer-cvslog] r21514 - trunk/libmpcodecs/vd_ffmpeg.c
reimar
subversion at mplayerhq.hu
Wed Dec 6 11:41:34 CET 2006
Author: reimar
Date: Wed Dec 6 11:41:34 2006
New Revision: 21514
Modified:
trunk/libmpcodecs/vd_ffmpeg.c
Log:
Fix memleak if vd_ffmpeg init fails
Modified: trunk/libmpcodecs/vd_ffmpeg.c
==============================================================================
--- trunk/libmpcodecs/vd_ffmpeg.c (original)
+++ trunk/libmpcodecs/vd_ffmpeg.c Wed Dec 6 11:41:34 2006
@@ -242,6 +242,7 @@
lavc_codec = (AVCodec *)avcodec_find_decoder_by_name(sh->codec->dll);
if(!lavc_codec){
mp_msg(MSGT_DECVIDEO,MSGL_ERR,MSGTR_MissingLAVCcodec,sh->codec->dll);
+ uninit(sh);
return 0;
}
@@ -406,6 +407,7 @@
/* open it */
if (avcodec_open(avctx, lavc_codec) < 0) {
mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantOpenCodec);
+ uninit(sh);
return 0;
}
mp_msg(MSGT_DECVIDEO,MSGL_V,"INFO: libavcodec init OK!\n");
@@ -429,7 +431,7 @@
);
}
- if (avcodec_close(avctx) < 0)
+ if (avctx && avctx->codec && avcodec_close(avctx) < 0)
mp_msg(MSGT_DECVIDEO,MSGL_ERR, MSGTR_CantCloseCodec);
av_freep(&avctx->extradata);
More information about the MPlayer-cvslog
mailing list