[FFmpeg-cvslog] aacdec: check init_get_bits return

Michael Niedermayer git at videolan.org
Sun Jan 27 23:56:26 CET 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jan 27 22:44:29 2013 +0100| [73abc3a634d84e4cc8951787323b594c5476e4a8] | committer: Michael Niedermayer

aacdec: check init_get_bits return

Also fixes an integer overflow

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

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

 libavcodec/aacdec.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c
index 49e9b60..2538948 100644
--- a/libavcodec/aacdec.c
+++ b/libavcodec/aacdec.c
@@ -774,13 +774,15 @@ static int decode_audio_specific_config(AACContext *ac,
 {
     GetBitContext gb;
     int i;
+    int ret;
 
     av_dlog(avctx, "audio specific config size %d\n", bit_size >> 3);
     for (i = 0; i < bit_size >> 3; i++)
          av_dlog(avctx, "%02x ", data[i]);
     av_dlog(avctx, "\n");
 
-    init_get_bits(&gb, data, bit_size);
+    if ((ret = init_get_bits(&gb, data, bit_size)) < 0)
+        return ret;
 
     if ((i = avpriv_mpeg4audio_get_config(m4ac, data, bit_size, sync_extension)) < 0)
         return -1;
@@ -2922,7 +2924,8 @@ static int latm_decode_frame(AVCodecContext *avctx, void *out,
     int                 muxlength, err;
     GetBitContext       gb;
 
-    init_get_bits(&gb, avpkt->data, avpkt->size * 8);
+    if ((err = init_get_bits8(&gb, avpkt->data, avpkt->size)) < 0)
+        return err;
 
     // check for LOAS sync word
     if (get_bits(&gb, 11) != LOAS_SYNC_WORD)



More information about the ffmpeg-cvslog mailing list