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:56:32 +0200 |
commit | 7eee79ea2fd3095984fbb3b684d4c598a0267e70 (patch) | |
tree | 6238a5e8a22da2fac2dac2eadd9fcab2c5b6adf0 | |
parent | 458933fdb8d5a9936088cfa9a466842f7b8da2f0 (diff) | |
download | ffmpeg-7eee79ea2fd3095984fbb3b684d4c598a0267e70.tar.gz |
Avoid a deadlock when decoding wma.
Fixes ticket #2925.
(cherry picked from commit ec8a4841f7e81040f9a2757f23e70dff5e6b33a4)
-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 cdd285002d..40a1040d90 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -506,6 +506,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) |