diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-01-27 22:44:29 +0100 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-01-27 23:47:23 +0100 |
commit | 73abc3a634d84e4cc8951787323b594c5476e4a8 (patch) | |
tree | 2ed0b352c97326eeb3b69c6288de203c5998d4bc /libavcodec/aacdec.c | |
parent | 8888c72fcfe1419668cc41dca4399374e6c09680 (diff) | |
download | ffmpeg-73abc3a634d84e4cc8951787323b594c5476e4a8.tar.gz |
aacdec: check init_get_bits return
Also fixes an integer overflow
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 49e9b60f44..2538948edd 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) |