[FFmpeg-cvslog] r11608 - in trunk/libavcodec: intrax8.c intrax8.h vc1.c wmv2dec.c

andoma subversion
Fri Jan 25 08:37:46 CET 2008


Author: andoma
Date: Fri Jan 25 08:37:46 2008
New Revision: 11608

Log:
Correctly clean up IntraX8Context upon codec close.

patch by Zdenek Kabelac, zdenek d kabelac a gmail d com


Modified:
   trunk/libavcodec/intrax8.c
   trunk/libavcodec/intrax8.h
   trunk/libavcodec/vc1.c
   trunk/libavcodec/wmv2dec.c

Modified: trunk/libavcodec/intrax8.c
==============================================================================
--- trunk/libavcodec/intrax8.c	(original)
+++ trunk/libavcodec/intrax8.c	Fri Jan 25 08:37:46 2008
@@ -677,6 +677,15 @@ void ff_intrax8_common_init(IntraX8Conte
 }
 
 /**
+ * Destroy IntraX8 frame structure.
+ * @param w pointer to IntraX8Context
+ */
+void ff_intrax8_common_end(IntraX8Context * w)
+{
+    av_freep(&w->prediction_table);
+}
+
+/**
  * Decode single IntraX8 frame.
  * The parent codec must fill s->loopfilter and s->gb (bitstream).
  * The parent codec must call MPV_frame_start(), ff_er_frame_start() before calling this function.

Modified: trunk/libavcodec/intrax8.h
==============================================================================
--- trunk/libavcodec/intrax8.h	(original)
+++ trunk/libavcodec/intrax8.h	Fri Jan 25 08:37:46 2008
@@ -51,6 +51,7 @@ typedef struct{
 } IntraX8Context;
 
 void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s);
+void ff_intrax8_common_end(IntraX8Context * w);
 int  ff_intrax8_decode_picture(IntraX8Context * w, int quant, int halfpq);
 
 #endif /* FFMPEG_INTRAX8_H */

Modified: trunk/libavcodec/vc1.c
==============================================================================
--- trunk/libavcodec/vc1.c	(original)
+++ trunk/libavcodec/vc1.c	Fri Jan 25 08:37:46 2008
@@ -4119,6 +4119,7 @@ static int vc1_decode_end(AVCodecContext
     av_freep(&v->acpred_plane);
     av_freep(&v->over_flags_plane);
     av_freep(&v->mb_type_base);
+    ff_intrax8_common_end(&v->x8);
     return 0;
 }
 

Modified: trunk/libavcodec/wmv2dec.c
==============================================================================
--- trunk/libavcodec/wmv2dec.c	(original)
+++ trunk/libavcodec/wmv2dec.c	Fri Jan 25 08:37:46 2008
@@ -474,6 +474,14 @@ static int wmv2_decode_init(AVCodecConte
     return 0;
 }
 
+static int wmv2_decode_end(AVCodecContext *avctx)
+{
+    Wmv2Context *w = avctx->priv_data;
+
+    ff_intrax8_common_end(&w->x8);
+    return ff_h263_decode_end(avctx);
+}
+
 AVCodec wmv2_decoder = {
     "wmv2",
     CODEC_TYPE_VIDEO,
@@ -481,7 +489,7 @@ AVCodec wmv2_decoder = {
     sizeof(Wmv2Context),
     wmv2_decode_init,
     NULL,
-    ff_h263_decode_end,
+    wmv2_decode_end,
     ff_h263_decode_frame,
     CODEC_CAP_DRAW_HORIZ_BAND | CODEC_CAP_DR1,
 };




More information about the ffmpeg-cvslog mailing list