diff options
author | Måns Rullgård <mans@mansr.com> | 2008-02-24 18:56:52 +0000 |
---|---|---|
committer | Måns Rullgård <mans@mansr.com> | 2008-02-24 18:56:52 +0000 |
commit | 6f4e2b5a9564d012c05ba361020768c925dda5e1 (patch) | |
tree | 8e6e106dfcdf73874c3fa37d51a980863707040e /libavcodec/vp3.c | |
parent | ac6f133027263749e2f8c7269367d0558f3781bc (diff) | |
download | ffmpeg-streaming-6f4e2b5a9564d012c05ba361020768c925dda5e1.zip ffmpeg-streaming-6f4e2b5a9564d012c05ba361020768c925dda5e1.tar.gz |
fix memory leaks in vp3 decoder
Originally committed as revision 12191 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/vp3.c')
-rw-r--r-- | libavcodec/vp3.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c index 2beb93f..eade1eb 100644 --- a/libavcodec/vp3.c +++ b/libavcodec/vp3.c @@ -2313,7 +2313,9 @@ if (!s->keyframe) { static int vp3_decode_end(AVCodecContext *avctx) { Vp3DecodeContext *s = avctx->priv_data; + int i; + av_free(s->superblock_coding); av_free(s->all_fragments); av_free(s->coeffs); av_free(s->coded_fragment_list); @@ -2322,6 +2324,19 @@ static int vp3_decode_end(AVCodecContext *avctx) av_free(s->macroblock_fragments); av_free(s->macroblock_coding); + for (i = 0; i < 16; i++) { + free_vlc(&s->dc_vlc[i]); + free_vlc(&s->ac_vlc_1[i]); + free_vlc(&s->ac_vlc_2[i]); + free_vlc(&s->ac_vlc_3[i]); + free_vlc(&s->ac_vlc_4[i]); + } + + free_vlc(&s->superblock_run_length_vlc); + free_vlc(&s->fragment_run_length_vlc); + free_vlc(&s->mode_code_vlc); + free_vlc(&s->motion_vector_vlc); + /* release all frames */ if (s->golden_frame.data[0] && s->golden_frame.data[0] != s->last_frame.data[0]) avctx->release_buffer(avctx, &s->golden_frame); |