dxa: check vectors of 4x4 motion blocks
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
89d998f1c1
commit
f96e0eb238
@ -71,6 +71,11 @@ static int decode_13(AVCodecContext *avctx, DxaDecContext *c, uint8_t* dst,
|
|||||||
case 4: // motion compensation
|
case 4: // motion compensation
|
||||||
x = (*mv) >> 4; if(x & 8) x = 8 - x;
|
x = (*mv) >> 4; if(x & 8) x = 8 - x;
|
||||||
y = (*mv++) & 0xF; if(y & 8) y = 8 - y;
|
y = (*mv++) & 0xF; if(y & 8) y = 8 - y;
|
||||||
|
if (i < -x || avctx->width - i - 4 < x ||
|
||||||
|
j < -y || avctx->height - j - 4 < y) {
|
||||||
|
av_log(avctx, AV_LOG_ERROR, "MV %d %d out of bounds\n", x,y);
|
||||||
|
return AVERROR_INVALIDDATA;
|
||||||
|
}
|
||||||
tmp2 += x + y*stride;
|
tmp2 += x + y*stride;
|
||||||
case 0: // skip
|
case 0: // skip
|
||||||
case 5: // skip in method 12
|
case 5: // skip in method 12
|
||||||
|
Loading…
x
Reference in New Issue
Block a user