wmaprodec: check num_sfb for validity. Fix out of array accesses

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2012-11-14 21:14:40 +01:00
parent 30bce34b67
commit 50f0a6b4e6
1 changed files with 4 additions and 0 deletions

View File

@ -412,6 +412,10 @@ static av_cold int decode_init(AVCodecContext *avctx)
}
s->sfb_offsets[i][band - 1] = subframe_len;
s->num_sfb[i] = band - 1;
if (s->num_sfb[i] <= 0) {
av_log(avctx, AV_LOG_ERROR, "num_sfb invalid\n");
return AVERROR_INVALIDDATA;
}
}