[FFmpeg-cvslog] aacdec: Fix null pointer crash

Michael Niedermayer git at videolan.org
Sat Dec 17 05:16:28 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sat Dec 17 05:02:11 2011 +0100| [f37b2d5a6884c7bea87a6c7454239381449bd637] | committer: Michael Niedermayer

aacdec: Fix null pointer crash
Fixes bug170
Bug found by: Gautam Gupta

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

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

 libavcodec/mpeg4audio.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/libavcodec/mpeg4audio.c b/libavcodec/mpeg4audio.c
index 6744593..abd3fa4 100644
--- a/libavcodec/mpeg4audio.c
+++ b/libavcodec/mpeg4audio.c
@@ -82,6 +82,9 @@ int avpriv_mpeg4audio_get_config(MPEG4AudioConfig *c, const uint8_t *buf,
     GetBitContext gb;
     int specific_config_bitindex;
 
+    if(bit_size<=0)
+        return AVERROR_INVALIDDATA;
+
     init_get_bits(&gb, buf, bit_size);
     c->object_type = get_object_type(&gb);
     c->sample_rate = get_sample_rate(&gb, &c->sampling_index);



More information about the ffmpeg-cvslog mailing list