mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-12-23 12:43:46 +02:00
avcodec/x86/mpegvideodsp: Fix signedness bug in need_emu
Fixes: out of array read
Fixes: 3516/attachment-311488.dat
Found-by: Insu Yun, Georgia Tech.
Tested-by: wuninsu@gmail.com
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 58cf31cee7
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
b3067f95c9
commit
96fe37a339
@ -52,8 +52,9 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src,
|
|||||||
const int dyh = (dyy - (1 << (16 + shift))) * (h - 1);
|
const int dyh = (dyy - (1 << (16 + shift))) * (h - 1);
|
||||||
const int dxh = dxy * (h - 1);
|
const int dxh = dxy * (h - 1);
|
||||||
const int dyw = dyx * (w - 1);
|
const int dyw = dyx * (w - 1);
|
||||||
int need_emu = (unsigned) ix >= width - w ||
|
int need_emu = (unsigned) ix >= width - w || width < w ||
|
||||||
(unsigned) iy >= height - h;
|
(unsigned) iy >= height - h || height< h
|
||||||
|
;
|
||||||
|
|
||||||
if ( // non-constant fullpel offset (3% of blocks)
|
if ( // non-constant fullpel offset (3% of blocks)
|
||||||
((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
|
((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |
|
||||||
|
Loading…
Reference in New Issue
Block a user