aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/wmaprodec.c
diff options
context:
space:
mode:
authorLuca Barbato <lu_zero@gentoo.org>2013-06-29 02:16:50 +0200
committerReinhard Tartler <siretart@tauware.de>2013-06-30 16:03:27 +0200
commitefcfd50c9fec0670489d1c73b86d1247db29d8b3 (patch)
treefc84ff6f87ff0fccc01e5bb1fc2a33b80b98ce26 /libavcodec/wmaprodec.c
parent8bd037293769c5ed65adce83ba097571ff4d6faf (diff)
downloadffmpeg-efcfd50c9fec0670489d1c73b86d1247db29d8b3.tar.gz
wmapro: error out on impossible scale factor offsets
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 02ec656af72030eea4f3d63e30b25625cce6a3df) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavcodec/wmaprodec.c')
-rw-r--r--libavcodec/wmaprodec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/wmaprodec.c b/libavcodec/wmaprodec.c
index 392d146a11..ed9c6d31de 100644
--- a/libavcodec/wmaprodec.c
+++ b/libavcodec/wmaprodec.c
@@ -439,7 +439,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;
}
}