[FFmpeg-soc] [soc]: r5414 - jpeg2000/j2kdec.c

jai_menon subversion at mplayerhq.hu
Mon Oct 19 00:22:36 CEST 2009


Author: jai_menon
Date: Mon Oct 19 00:22:36 2009
New Revision: 5414

Log:
Release allocated buffer after decoding has finished.

Modified:
   jpeg2000/j2kdec.c

Modified: jpeg2000/j2kdec.c
==============================================================================
--- jpeg2000/j2kdec.c	Sun Oct 18 23:53:00 2009	(r5413)
+++ jpeg2000/j2kdec.c	Mon Oct 19 00:22:36 2009	(r5414)
@@ -1028,6 +1028,16 @@ static av_cold int j2kdec_init(AVCodecCo
     return 0;
 }
 
+static av_cold int decode_end(AVCodecContext *avctx)
+{
+    J2kDecoderContext *s = avctx->priv_data;
+
+    if (s->picture.data[0])
+        avctx->release_buffer(avctx, &s->picture);
+
+    return 0;
+}
+
 AVCodec jpeg2000_decoder = {
     "j2k",
     CODEC_TYPE_VIDEO,
@@ -1035,7 +1045,7 @@ AVCodec jpeg2000_decoder = {
     sizeof(J2kDecoderContext),
     j2kdec_init,
     NULL,
-    NULL,
+    decode_end,
     decode_frame,
     0,
     .pix_fmts =


More information about the FFmpeg-soc mailing list