[FFmpeg-cvslog] Avoid a deadlock when decoding wma.

Carl Eugen Hoyos git at videolan.org
Mon Sep 2 10:11:20 CEST 2013


ffmpeg | branch: release/1.0 | Carl Eugen Hoyos <cehoyos at ag.or.at> | Mon Sep  2 08:32:24 2013 +0200| [7599284ad34972e4a0680f0f8f4a51e30ec86b3e] | committer: Carl Eugen Hoyos

Avoid a deadlock when decoding wma.

Fixes ticket #2925.
(cherry picked from commit ec8a4841f7e81040f9a2757f23e70dff5e6b33a4)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7599284ad34972e4a0680f0f8f4a51e30ec86b3e
---

 libavcodec/wmadec.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index 39e50a4..fa0d747 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)



More information about the ffmpeg-cvslog mailing list