diff truemotion2.c @ 10399:136334ad62b3 libavcodec

Release frame after decoding is done
author kostya
date Wed, 14 Oct 2009 05:28:24 +0000
parents d7ed9dcc78e3
children 8a137661f31e
line wrap: on
line diff
--- a/truemotion2.c	Tue Oct 13 20:48:51 2009 +0000
+++ b/truemotion2.c	Wed Oct 14 05:28:24 2009 +0000
@@ -845,6 +845,7 @@
 
 static av_cold int decode_end(AVCodecContext *avctx){
     TM2Context * const l = avctx->priv_data;
+    AVFrame *pic = &l->pic;
     int i;
 
     if(l->last)
@@ -862,6 +863,11 @@
         av_free(l->U2);
         av_free(l->V2);
     }
+
+    if (pic->data[0])
+        avctx->release_buffer(avctx, pic);
+    av_freep(&l->pic);
+
     return 0;
 }