avcodec/binkaudio: Check return value of functions that can fail

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
This commit is contained in:
Andreas Rheinhardt 2020-11-30 22:30:49 +01:00 committed by Andreas Rheinhardt
parent 85aed2e390
commit 0062aca592
1 changed files with 5 additions and 3 deletions

View File

@ -70,7 +70,7 @@ static av_cold int decode_init(AVCodecContext *avctx)
BinkAudioContext *s = avctx->priv_data; BinkAudioContext *s = avctx->priv_data;
int sample_rate = avctx->sample_rate; int sample_rate = avctx->sample_rate;
int sample_rate_half; int sample_rate_half;
int i; int i, ret;
int frame_len_bits; int frame_len_bits;
/* determine frame length */ /* determine frame length */
@ -132,11 +132,13 @@ static av_cold int decode_init(AVCodecContext *avctx)
s->first = 1; s->first = 1;
if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT) if (CONFIG_BINKAUDIO_RDFT_DECODER && avctx->codec->id == AV_CODEC_ID_BINKAUDIO_RDFT)
ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R); ret = ff_rdft_init(&s->trans.rdft, frame_len_bits, DFT_C2R);
else if (CONFIG_BINKAUDIO_DCT_DECODER) else if (CONFIG_BINKAUDIO_DCT_DECODER)
ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III); ret = ff_dct_init(&s->trans.dct, frame_len_bits, DCT_III);
else else
av_assert0(0); av_assert0(0);
if (ret < 0)
return ret;
s->pkt = av_packet_alloc(); s->pkt = av_packet_alloc();
if (!s->pkt) if (!s->pkt)