From ec8a4841f7e81040f9a2757f23e70dff5e6b33a4 Mon Sep 17 00:00:00 2001 From: Carl Eugen Hoyos Date: Mon, 2 Sep 2013 08:32:24 +0200 Subject: Avoid a deadlock when decoding wma. Fixes ticket #2925. --- libavcodec/wmadec.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'libavcodec/wmadec.c') 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) -- cgit v1.2.3