summaryrefslogtreecommitdiff
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2017-02-16 00:54:31 +0100
committerAndreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>2017-02-17 01:45:19 +0100
commit9ccc6cecd2d0645f5073382360509eb278b239b1 (patch)
tree0a021a69afe30296e01a8cf66ada89d40f498987 /libavcodec/wmaprodec.c
parent783b350b2e49d06030b30ee9b7e1aa5825e4a5a5 (diff)
wmaprodec: fix leaking fdsp on init failure
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 4d530264df..1ad1e23541 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -323,9 +323,6 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx)
}
s->avctx = avctx;
- s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
- if (!s->fdsp)
- return AVERROR(ENOMEM);
init_put_bits(&s->pb, s->frame_data, MAX_FRAMESIZE);
@@ -523,6 +520,10 @@ static av_cold int decode_init(WMAProDecodeCtx *s, AVCodecContext *avctx)
}
}
+ s->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
+ if (!s->fdsp)
+ return AVERROR(ENOMEM);
+
/** init MDCT, FIXME: only init needed sizes */
for (i = 0; i < WMAPRO_BLOCK_SIZES; i++)
ff_mdct_init(&s->mdct_ctx[i], WMAPRO_BLOCK_MIN_BITS+1+i, 1,