diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-09-02 08:32:24 +0200 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2013-09-02 08:54:32 +0200 |
commit | f5a4bd23e9aedaf2691f74751e26f2f36e4ea4ab (patch) | |
tree | 5d29ea175d0c759b9e1d21ac4d3887f73b953973 /libavcodec/wmadec.c | |
parent | 8e1760f37f7a0b5354173cf2c28f4d7f04ca1cdf (diff) | |
download | ffmpeg-f5a4bd23e9aedaf2691f74751e26f2f36e4ea4ab.tar.gz |
Avoid a deadlock when decoding wma.
Fixes ticket #2925.
(cherry picked from commit ec8a4841f7e81040f9a2757f23e70dff5e6b33a4)
Diffstat (limited to 'libavcodec/wmadec.c')
-rw-r--r-- | libavcodec/wmadec.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index d46eb33c41..8fc0cca807 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -512,6 +512,10 @@ static int wma_decode_block(WMACodecContext *s) coef escape coding */ total_gain = 1; for(;;) { + if (get_bits_left(&s->gb) < 7) { + av_log(s->avctx, AV_LOG_ERROR, "total_gain overread\n"); + return AVERROR_INVALIDDATA; + } a = get_bits(&s->gb, 7); total_gain += a; if (a != 127) |