From 591bae8f0c2f7a25d430ac7acfb46f7b6704e249 Mon Sep 17 00:00:00 2001 From: npt-1707 Date: Thu, 17 Apr 2025 17:30:10 +0800 Subject: [PATCH] third_party/ffmpeg/libavcodec/x86/mpegvideodsp.c: Fix signedness bug in need_emu --- third_party/ffmpeg/libavcodec/x86/mpegvideodsp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/ffmpeg/libavcodec/x86/mpegvideodsp.c b/third_party/ffmpeg/libavcodec/x86/mpegvideodsp.c index 941a8e2e4c..93b4438fc4 100644 --- a/third_party/ffmpeg/libavcodec/x86/mpegvideodsp.c +++ b/third_party/ffmpeg/libavcodec/x86/mpegvideodsp.c @@ -53,8 +53,8 @@ static void gmc_mmx(uint8_t *dst, uint8_t *src, const int dyh = (dyy - (1 << (16 + shift))) * (h - 1); const int dxh = dxy * (h - 1); const int dyw = dyx * (w - 1); - int need_emu = (unsigned) ix >= width - w || - (unsigned) iy >= height - h; + int need_emu = (unsigned) ix >= width - w || width < w || + (unsigned) iy >= height - h || height < h; if ( // non-constant fullpel offset (3% of blocks) ((ox ^ (ox + dxw)) | (ox ^ (ox + dxh)) | (ox ^ (ox + dxw + dxh)) |