diff options
author | Alex Converse <alex.converse@gmail.com> | 2012-01-27 14:24:07 -0800 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2012-04-01 18:33:27 +0200 |
commit | 88b47010c4e2ed0d756f30c54b0d88153c33aec5 (patch) | |
tree | 7e5fab97b5e80cc63245555445bab7dd8c378ee9 | |
parent | b56b7b9081d5b9048732c0db171c7b6af9831bad (diff) | |
download | ffmpeg-88b47010c4e2ed0d756f30c54b0d88153c33aec5.tar.gz |
wmadec: Verify bitstream size makes sense before calling init_get_bits.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
(cherry picked from commit 48f1e5212c90b511c90fa0449655abb06a9edda2)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r-- | libavcodec/wmadec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 479b34c3e0..c8e1de2c32 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -864,6 +864,8 @@ static int wma_decode_superframe(AVCodecContext *avctx, /* read each frame starting from bit_offset */ pos = bit_offset + 4 + 4 + s->byte_offset_bits + 3; + if (pos >= MAX_CODED_SUPERFRAME_SIZE * 8) + return AVERROR_INVALIDDATA; init_get_bits(&s->gb, buf + (pos >> 3), (MAX_CODED_SUPERFRAME_SIZE - (pos >> 3))*8); len = pos & 7; if (len > 0) |