diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-05-06 17:55:12 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2021-05-12 06:00:13 +0200 |
commit | 20232cbbf7cd9f6e2f139db8d3d9c7040a1e5002 (patch) | |
tree | 296b96aaca75365e82936b436608e0054949c746 /libavcodec | |
parent | 08fcb43affabe53a549241cc199542e9ac89070c (diff) | |
download | ffmpeg-20232cbbf7cd9f6e2f139db8d3d9c7040a1e5002.tar.gz |
avcodec/wmaenc: Check operations that can fail
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/wmaenc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c index 2a78325298..3035668487 100644 --- a/libavcodec/wmaenc.c +++ b/libavcodec/wmaenc.c @@ -88,8 +88,11 @@ static av_cold int encode_init(AVCodecContext *avctx) return ret; /* init MDCT */ - for (i = 0; i < s->nb_block_sizes; i++) - ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0); + for (i = 0; i < s->nb_block_sizes; i++) { + ret = ff_mdct_init(&s->mdct_ctx[i], s->frame_len_bits - i + 1, 0, 1.0); + if (ret < 0) + return ret; + } block_align = avctx->bit_rate * (int64_t) s->frame_len / (avctx->sample_rate * 8); |