avcodec/wmaprodec: Fix integer overflow in sfb_offsets initialization
[ffmpeg.git] / libavcodec / wmaprodec.c
index f45e1fc..56d6d32 100644 (file)
@@ -422,6 +422,9 @@ static av_cold int decode_init(AVCodecContext *avctx)
             offset &= ~3;
             if (offset > s->sfb_offsets[i][band - 1])
                 s->sfb_offsets[i][band++] = offset;
+
+            if (offset >= subframe_len)
+                break;
         }
         s->sfb_offsets[i][band - 1] = subframe_len;
         s->num_sfb[i]               = band - 1;