Commit 642c49c9 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/libaacplus: Check for av_malloc() failure

Fixes CID1271046
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 48214956
......@@ -82,6 +82,10 @@ static av_cold int aacPlus_encode_init(AVCodecContext *avctx)
if (aacplusEncGetDecoderSpecificInfo(s->aacplus_handle, &buffer,
&decoder_specific_info_size) == 1) {
avctx->extradata = av_malloc(decoder_specific_info_size + FF_INPUT_BUFFER_PADDING_SIZE);
if (!avctx->extradata) {
free(buffer);
return AVERROR(ENOMEM);
}
avctx->extradata_size = decoder_specific_info_size;
memcpy(avctx->extradata, buffer, avctx->extradata_size);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment