Commit e7566359 authored by Michael Niedermayer's avatar Michael Niedermayer

eamad: Check against minimum supported dimensions

Fixes out of array reads

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent b937d369
......@@ -257,6 +257,11 @@ static int decode_frame(AVCodecContext *avctx,
calc_quant_matrix(s, buf[13]);
buf += 16;
if (width < 16 || height < 16) {
av_log(avctx, AV_LOG_ERROR, "Dimensions too small\n");
return AVERROR_INVALIDDATA;
}
if (avctx->width != width || avctx->height != height) {
if((width * height)/2048*7 > buf_end-buf)
return AVERROR_INVALIDDATA;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment