[FFmpeg-cvslog] libxvid: check & clear encoder_handle

Michael Niedermayer git at videolan.org
Sat Mar 2 20:45:42 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Mar  2 20:32:21 2013 +0100| [667bf156526ffba556f3dd906d63d1952866ea63] | committer: Michael Niedermayer

libxvid: check & clear encoder_handle

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=667bf156526ffba556f3dd906d63d1952866ea63
---

 libavcodec/libxvid.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 9c86e3c..fac2e8c 100644
--- a/libavcodec/libxvid.c
+++ b/libavcodec/libxvid.c
@@ -735,7 +735,9 @@ static int xvid_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 static av_cold int xvid_encode_close(AVCodecContext *avctx) {
     struct xvid_context *x = avctx->priv_data;
 
-    xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
+    if(x->encoder_handle)
+        xvid_encore(x->encoder_handle, XVID_ENC_DESTROY, NULL, NULL);
+    x->encoder_handle = NULL;
 
     av_freep(&avctx->extradata);
     if( x->twopassbuffer != NULL ) {



More information about the ffmpeg-cvslog mailing list