[FFmpeg-cvslog] avcodec/libaacplus: Check for av_malloc() failure

Michael Niedermayer git at videolan.org
Sun Feb 22 14:08:47 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 22 14:00:53 2015 +0100| [642c49c983df2f56b656ce668f2a0257a1939578] | committer: Michael Niedermayer

avcodec/libaacplus: Check for av_malloc() failure

Fixes CID1271046

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=642c49c983df2f56b656ce668f2a0257a1939578
---

 libavcodec/libaacplus.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libaacplus.c b/libavcodec/libaacplus.c
index 545e240..9087d00 100644
--- a/libavcodec/libaacplus.c
+++ b/libavcodec/libaacplus.c
@@ -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);
         }



More information about the ffmpeg-cvslog mailing list