diff indeo2.c @ 10399:136334ad62b3 libavcodec

Release frame after decoding is done
author kostya
date Wed, 14 Oct 2009 05:28:24 +0000
parents d719a2711c64
children 8a137661f31e
line wrap: on
line diff
--- a/indeo2.c	Tue Oct 13 20:48:51 2009 +0000
+++ b/indeo2.c	Wed Oct 14 05:28:24 2009 +0000
@@ -213,6 +213,17 @@
     return 0;
 }
 
+static av_cold int ir2_decode_end(AVCodecContext *avctx){
+    Ir2Context * const ic = avctx->priv_data;
+    AVFrame *pic = &ic->picture;
+
+    if (pic->data[0])
+        avctx->release_buffer(avctx, pic);
+    av_freep(&ic->picture);
+
+    return 0;
+}
+
 AVCodec indeo2_decoder = {
     "indeo2",
     CODEC_TYPE_VIDEO,
@@ -220,7 +231,7 @@
     sizeof(Ir2Context),
     ir2_decode_init,
     NULL,
-    NULL,
+    ir2_decode_end,
     ir2_decode_frame,
     CODEC_CAP_DR1,
     .long_name = NULL_IF_CONFIG_SMALL("Intel Indeo 2"),