diff options
author | Vitor Sessak <vitor1001@gmail.com> | 2010-03-03 17:24:32 +0000 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2011-12-24 16:28:19 +0100 |
commit | 280590e3380d8649e5b191c653b0f974626c8eeb (patch) | |
tree | e3db698ae75d209b45734c9a844b7167986296d3 | |
parent | 9767ea7aa77a331f73268758af2e1858222f5915 (diff) | |
download | ffmpeg-280590e3380d8649e5b191c653b0f974626c8eeb.tar.gz |
Plug some memory leaks in the VP6 decoder
Originally committed as revision 22172 to svn://svn.ffmpeg.org/ffmpeg/trunk
(cherry picked from commit 0a41faa9a77dc83d8d933e99f1ba902ecd146e79)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/vp56.c | 11 | ||||
-rw-r--r-- | libavcodec/vp6.c | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/vp56.c b/libavcodec/vp56.c index ad11b5289a..c09dbeb2f8 100644 --- a/libavcodec/vp56.c +++ b/libavcodec/vp56.c @@ -685,6 +685,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_free(s->above_blocks); av_free(s->macroblocks); @@ -695,5 +696,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 288227b174..0d1b12c4bf 100644 --- a/libavcodec/vp6.c +++ b/libavcodec/vp6.c @@ -230,6 +230,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); |