[FFmpeg-cvslog] avcodec/aac_adtstoasc_bsf: Clear extradata_size on allocation failure

Michael Niedermayer git at videolan.org
Tue Feb 17 23:05:47 CET 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Tue Feb 17 22:58:31 2015 +0100| [2e786bc4989835f6d82cc187c4bb37716521a0bf] | committer: Michael Niedermayer

avcodec/aac_adtstoasc_bsf: Clear extradata_size on allocation failure

This keeps the fields consistent

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

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

 libavcodec/aac_adtstoasc_bsf.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavcodec/aac_adtstoasc_bsf.c b/libavcodec/aac_adtstoasc_bsf.c
index 8c5d580..1f11d02 100644
--- a/libavcodec/aac_adtstoasc_bsf.c
+++ b/libavcodec/aac_adtstoasc_bsf.c
@@ -90,8 +90,10 @@ static int aac_adtstoasc_filter(AVBitStreamFilterContext *bsfc,
         av_free(avctx->extradata);
         avctx->extradata_size = 2 + pce_size;
         avctx->extradata = av_mallocz(avctx->extradata_size + FF_INPUT_BUFFER_PADDING_SIZE);
-        if (!avctx->extradata)
+        if (!avctx->extradata) {
+            avctx->extradata_size = 0;
             return AVERROR(ENOMEM);
+        }
 
         init_put_bits(&pb, avctx->extradata, avctx->extradata_size);
         put_bits(&pb, 5, hdr.object_type);



More information about the ffmpeg-cvslog mailing list