eamad: Check against minimum supported dimensions
Fixes out of array reads Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
parent
b937d3694e
commit
e756635964
@ -257,6 +257,11 @@ static int decode_frame(AVCodecContext *avctx,
|
|||||||
calc_quant_matrix(s, buf[13]);
|
calc_quant_matrix(s, buf[13]);
|
||||||
buf += 16;
|
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 (avctx->width != width || avctx->height != height) {
|
||||||
if((width * height)/2048*7 > buf_end-buf)
|
if((width * height)/2048*7 > buf_end-buf)
|
||||||
return AVERROR_INVALIDDATA;
|
return AVERROR_INVALIDDATA;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user