aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2010-03-03 17:24:32 +0000
committerVitor Sessak <vitor1001@gmail.com>2010-03-03 17:24:32 +0000
commit0a41faa9a77dc83d8d933e99f1ba902ecd146e79 (patch)
tree0e0b15179b6f3b6686789f58049878b58912549a /libavcodec
parentd7f5e520bf18cfe0f288bee6c1004b715c32365e (diff)
downloadffmpeg-0a41faa9a77dc83d8d933e99f1ba902ecd146e79.tar.gz
Plug some memory leaks in the VP6 decoder
Originally committed as revision 22172 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/vp56.c12
-rw-r--r--libavcodec/vp6.c1
2 files changed, 13 insertions, 0 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c
index 63055f5059..dd8f05a8c3 100644
--- a/libavcodec/vp56.c
+++ b/libavcodec/vp56.c
@@ -26,6 +26,7 @@
#include "vp56.h"
#include "vp56data.h"
+#include "get_bits.h"
void vp56_init_dequant(VP56Context *s, int quantizer)
@@ -695,6 +696,7 @@ av_cold void vp56_init(AVCodecContext *avctx, int flip, int has_alpha)
av_cold int vp56_free(AVCodecContext *avctx)
{
VP56Context *s = avctx->priv_data;
+ int pt;
av_freep(&s->qscale_table);
av_freep(&s->above_blocks);
@@ -706,5 +708,15 @@ av_cold int vp56_free(AVCodecContext *avctx)
avctx->release_buffer(avctx, s->framep[VP56_FRAME_GOLDEN2]);
if (s->framep[VP56_FRAME_PREVIOUS]->data[0])
avctx->release_buffer(avctx, s->framep[VP56_FRAME_PREVIOUS]);
+
+ for (pt=0; pt < 2; pt++) {
+ int ct, cg;
+ free_vlc(&s->dccv_vlc[pt]);
+ free_vlc(&s->runv_vlc[pt]);
+ for (ct=0; ct<3; ct++)
+ for (cg = 0; cg < 6; cg++)
+ free_vlc(&s->ract_vlc[pt][ct][cg]);
+ }
+
return 0;
}
diff --git a/libavcodec/vp6.c b/libavcodec/vp6.c
index de98e61e6e..8bb60ede27 100644
--- a/libavcodec/vp6.c
+++ b/libavcodec/vp6.c
@@ -227,6 +227,7 @@ static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[],
nodes[map[2*i+1]].count = b + !b;
}
+ free_vlc(vlc);
/* then build the huffman tree accodring to probabilities */
ff_huff_build_tree(s->avctx, vlc, size, nodes, vp6_huff_cmp,
FF_HUFFMAN_FLAG_HNODE_FIRST);