summaryrefslogtreecommitdiff
path: root/libavcodec/libxvid.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-03-02 20:32:21 +0100
committerMichael Niedermayer <michaelni@gmx.at>2013-03-02 20:32:21 +0100
commit667bf156526ffba556f3dd906d63d1952866ea63 (patch)
tree0949d9bff703a7a73e0efdabf5c79ce07a052fa4 /libavcodec/libxvid.c
parent8fe59240a15d38bd0e5911ba8167afd328e064d1 (diff)
downloadffmpeg-667bf156526ffba556f3dd906d63d1952866ea63.tar.gz
libxvid: check & clear encoder_handle
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/libxvid.c')
-rw-r--r--libavcodec/libxvid.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libavcodec/libxvid.c b/libavcodec/libxvid.c
index 9c86e3c617..fac2e8c57f 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 ) {