summaryrefslogtreecommitdiff
path: root/libavcodec/atrac1.c
diff options
context:
space:
mode:
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-13 20:53:46 +0200
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>2020-09-15 19:25:25 +0200
commite75ccc81234a22eee90e2a31808639e754b97cd1 (patch)
tree0042211ed407e2bbd60aeb1c893972199a174dd3 /libavcodec/atrac1.c
parent8ddcbebc3f869def7819697d7f4f85b94308c570 (diff)
avcodec/atrac1: Check allocation of AVFloatDSPContext
Reviewed-by: Paul B Mahol <onemda@gmail.com> Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Diffstat (limited to 'libavcodec/atrac1.c')
-rw-r--r--libavcodec/atrac1.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/atrac1.c b/libavcodec/atrac1.c
index a8c8c91bcc..9ecd49273d 100644
--- a/libavcodec/atrac1.c
+++ b/libavcodec/atrac1.c
@@ -362,6 +362,10 @@ static av_cold int atrac1_decode_init(AVCodecContext *avctx)
ff_atrac_generate_tables();
q->fdsp = avpriv_float_dsp_alloc(avctx->flags & AV_CODEC_FLAG_BITEXACT);
+ if (!q->fdsp) {
+ atrac1_decode_end(avctx);
+ return AVERROR(ENOMEM);
+ }
q->bands[0] = q->low;
q->bands[1] = q->mid;