diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-01-10 13:00:19 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-01-10 13:03:15 +0100 |
commit | b563afe6fa9345a62750055998a28a3926c02334 (patch) | |
tree | a4b51af76442697ae05a86dd6e9eb48434e36adb /libavcodec/aacdec.c | |
parent | ac6e074fb711468a2ff3f241a1641dc5b34b386d (diff) | |
download | ffmpeg-streaming-b563afe6fa9345a62750055998a28a3926c02334.zip ffmpeg-streaming-b563afe6fa9345a62750055998a28a3926c02334.tar.gz |
Do not allow arbitrary packet size in aac decoder.
Fixes a crash with a file containing a 400MB packet reported in bug 420.
Diffstat (limited to 'libavcodec/aacdec.c')
-rw-r--r-- | libavcodec/aacdec.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/aacdec.c b/libavcodec/aacdec.c index 239153a..fcdfdb2 100644 --- a/libavcodec/aacdec.c +++ b/libavcodec/aacdec.c @@ -2665,6 +2665,9 @@ static int aac_decode_frame(AVCodecContext *avctx, void *data, if (ac->force_dmono_mode >= 0) ac->dmono_mode = ac->force_dmono_mode; + if (INT_MAX / 8 <= buf_size) + return AVERROR_INVALIDDATA; + init_get_bits(&gb, buf, buf_size * 8); if ((err = aac_decode_frame_int(avctx, data, got_frame_ptr, &gb, avpkt)) < 0) |