From 1221b024cb5703873e07e2b42a1872dfaae54431 Mon Sep 17 00:00:00 2001 From: ToadKing Date: Sun, 6 Jan 2013 20:34:05 -0500 Subject: [PATCH] (GX) fix potential memory corruption in 32-bit video conversion --- gx/gx_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gx/gx_video.c b/gx/gx_video.c index 1053360db1..27bb8a2271 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -570,7 +570,7 @@ static void update_texture_asm(const uint32_t *src, const uint32_t *dst, { \ const uint16_t *tmp_src = src; \ uint16_t *tmp_dst = dst; \ - for (unsigned x = 0; x < width2; x += 8, tmp_src += 32, tmp_dst += 128) \ + for (unsigned x = 0; x < width2 >> 2; x += 8, tmp_src += 32, tmp_dst += 128) \ { \ tmp_dst[ 0 + off] = tmp_src[0] | 0xFF00; \ tmp_dst[ 16 + off] = tmp_src[1]; \