aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-29 02:16:50 +0200
committerLuca Barbato <lu_zero@gentoo.org>2013-06-29 18:11:59 +0200
commit02ec656af72030eea4f3d63e30b25625cce6a3df (patch)
tree9578d1ddb33b2a8544e83249a60f844a836f7896
parentd4a217a408da4bd63acc02cd8f9ebe378a2ad65a (diff)
downloadffmpeg-02ec656af72030eea4f3d63e30b25625cce6a3df.tar.gz
wmapro: error out on impossible scale factor offsets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
-rw-r--r--libavcodec/wmaprodec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 302f58a483..d3bd3816fa 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -436,7 +436,8 @@ static av_cold int decode_init(AVCodecContext *avctx)
for (x = 0; x < num_possible_block_sizes; x++) {
int v = 0;
while (s->sfb_offsets[x][v + 1] << x < offset)
- ++v;
+ if (++v >= MAX_BANDS)
+ return AVERROR_INVALIDDATA;
s->sf_offsets[i][x][b] = v;
}
}