diff --git a/libavcodec/wmadec.c b/libavcodec/wmadec.c index 4fbbe39a4b..7505a9be3d 100644 --- a/libavcodec/wmadec.c +++ b/libavcodec/wmadec.c @@ -1282,7 +1282,7 @@ static int wma_decode_superframe(AVCodecContext *avctx, s->last_bitoffset = pos & 7; pos >>= 3; len = buf_size - pos; - if (len > MAX_CODED_SUPERFRAME_SIZE) { + if (len > MAX_CODED_SUPERFRAME_SIZE || len < 0) { return -1; } s->last_superframe_len = len;