]> rtime.felk.cvut.cz Git - frescor/ffmpeg.git/commitdiff
Correctly clean up IntraX8Context upon codec close.
authorandoma <andoma@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 25 Jan 2008 07:37:46 +0000 (07:37 +0000)
committerandoma <andoma@9553f0bf-9b14-0410-a0b8-cfaf0461ba5b>
Fri, 25 Jan 2008 07:37:46 +0000 (07:37 +0000)
patch by Zdenek Kabelac, zdenek d kabelac a gmail d com

git-svn-id: file:///var/local/repositories/ffmpeg/trunk@11608 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b

libavcodec/intrax8.c
libavcodec/intrax8.h
libavcodec/vc1.c
libavcodec/wmv2dec.c

index ec1567ea230a9e9841849d0b93dda3c38fb67627..0436deb4ce865ac008b37b9705a1eab7eddb5e69 100644 (file)
@@ -676,6 +676,15 @@ void ff_intrax8_common_init(IntraX8Context * w, MpegEncContext * const s){
     ff_init_scantable(s->dsp.idct_permutation, &w->scantable[2], wmv1_scantable[3]);
 }
 
+/**
+ * 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).
index fd8e36ccc43516f0a89a6f24bdc15338682fc15e..3f6de67da5d01b6e7489f608f9ba2d0cde204024 100644 (file)
@@ -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 */
index 86ca7b978bcdb962d8d2a739ca438f097d72a296..01cff4c057ed4299fc827e91ded88e577580a54b 100644 (file)
@@ -4119,6 +4119,7 @@ static int vc1_decode_end(AVCodecContext *avctx)
     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;
 }
 
index 842234bfe1a21610ddafa0f89916bca13051ca32..cb3795512475f75dd8b5e594c0be69792eaed2ab 100644 (file)
@@ -474,6 +474,14 @@ static int wmv2_decode_init(AVCodecContext *avctx){
     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,
 };