aac_adtstoasc_bsf: Check extradata memory allocation
authorHimangi Saraogi <himangi774@gmail.com>
Tue, 10 Feb 2015 22:07:40 +0000 (03:37 +0530)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 17 Feb 2015 17:18:10 +0000 (12:18 -0500)
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
libavcodec/aac_adtstoasc_bsf.c

index 733b08d..bedaa49 100644 (file)
@@ -89,6 +89,8 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
         }
         avctx->extradata_size = 2 + pce_size;
         avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
+        if (!avctx->extradata)
+            return AVERROR(ENOMEM);
 
         init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
         put_bits(&pb, 5, hdr.object_type);