aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarl Eugen Hoyos <cehoyos@ag.or.at>2013-09-02 08:32:24 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2013-09-02 09:41:14 +0200
commit7599284ad34972e4a0680f0f8f4a51e30ec86b3e (patch)
tree3fd7b71c548778d838a59457211c0b1403a85eaf
parent6b5c4be9e0b59b55f7c74466f0d6225623687c61 (diff)
downloadffmpeg-7599284ad34972e4a0680f0f8f4a51e30ec86b3e.tar.gz
Avoid a deadlock when decoding wma.
Fixes ticket #2925. (cherry picked from commit ec8a4841f7e81040f9a2757f23e70dff5e6b33a4)
-rw-r--r--libavcodec/wmadec.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 39e50a4ffd..fa0d747f8a 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -524,6 +524,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)