1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

rv10: check that extradata is large enough

Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC:libav-stable@libav.org
This commit is contained in:
Anton Khirnov 2013-04-09 20:33:25 +02:00
parent bac8d38c0a
commit 01d376f598

View File

@ -346,6 +346,11 @@ static int rv20_decode_picture_header(RVDecContext *rv)
f = get_bits(&s->gb, rpr_bits); f = get_bits(&s->gb, rpr_bits);
if (f) { if (f) {
if (s->avctx->extradata_size < 8 + 2 * f) {
av_log(s->avctx, AV_LOG_ERROR, "Extradata too small.\n");
return AVERROR_INVALIDDATA;
}
new_w = 4 * ((uint8_t*)s->avctx->extradata)[6 + 2 * f]; new_w = 4 * ((uint8_t*)s->avctx->extradata)[6 + 2 * f];
new_h = 4 * ((uint8_t*)s->avctx->extradata)[7 + 2 * f]; new_h = 4 * ((uint8_t*)s->avctx->extradata)[7 + 2 * f];
} else { } else {