[FFmpeg-devel] [PATCH]Fix deadlock in wma decoder

Carl Eugen Hoyos cehoyos at ag.or.at
Sun Sep 1 16:40:36 CEST 2013


Hi!

Attached patch fixes ticket #2925 here.

Please comment, Carl Eugen
-------------- next part --------------
diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c
index d46eb33..58b5bde 100644
--- a/libavcodec/wmadec.c
+++ b/libavcodec/wmadec.c
@@ -512,6 +512,8 @@ static int wma_decode_block(WMACodecContext *s)
        coef escape coding */
     total_gain = 1;
     for(;;) {
+        if (get_bits_left(&s->gb) < 7)
+            break;
         a = get_bits(&s->gb, 7);
         total_gain += a;
         if (a != 127)


More information about the ffmpeg-devel mailing list