aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-06-03 17:08:32 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-06-03 17:08:32 +0200
commit90b26d63ba0e657ecb04d50a4117d941027432db (patch)
tree8c189e4a940fd5ae7f2617663a096156c8e62dc5
parent576654302ba3ff04c9b5eaee9e21799dcb3f32c3 (diff)
downloadffmpeg-90b26d63ba0e657ecb04d50a4117d941027432db.tar.gz
avcodec/vp3: factorize out free_tables()
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/vp3.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/libavcodec/vp3.c b/libavcodec/vp3.c
index 77ae0b0c96..3c5a4cdaa2 100644
--- a/libavcodec/vp3.c
+++ b/libavcodec/vp3.c
@@ -262,6 +262,20 @@ typedef struct Vp3DecodeContext {
* VP3 specific functions
************************************************************************/
+static av_cold void free_tables(AVCodecContext *avctx)
+{
+ Vp3DecodeContext *s = avctx->priv_data;
+
+ av_freep(&s->superblock_coding);
+ av_freep(&s->all_fragments);
+ av_freep(&s->coded_fragment_list[0]);
+ av_freep(&s->dct_tokens_base);
+ av_freep(&s->superblock_fragments);
+ av_freep(&s->macroblock_coding);
+ av_freep(&s->motion_val[0]);
+ av_freep(&s->motion_val[1]);
+}
+
static void vp3_decode_flush(AVCodecContext *avctx)
{
Vp3DecodeContext *s = avctx->priv_data;
@@ -279,14 +293,7 @@ static av_cold int vp3_decode_end(AVCodecContext *avctx)
Vp3DecodeContext *s = avctx->priv_data;
int i;
- av_freep(&s->superblock_coding);
- av_freep(&s->all_fragments);
- av_freep(&s->coded_fragment_list[0]);
- av_freep(&s->dct_tokens_base);
- av_freep(&s->superblock_fragments);
- av_freep(&s->macroblock_coding);
- av_freep(&s->motion_val[0]);
- av_freep(&s->motion_val[1]);
+ free_tables(avctx);
av_freep(&s->edge_emu_buffer);
s->theora_tables = 0;