From d07718a03be25075abef1888b836dfb77e1c83a0 Mon Sep 17 00:00:00 2001 From: kub Date: Fri, 4 Mar 2022 19:39:44 +0000 Subject: [PATCH] fix a buffer overflow --- plat_sdl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plat_sdl.c b/plat_sdl.c index 729a0b0..a167a63 100644 --- a/plat_sdl.c +++ b/plat_sdl.c @@ -365,10 +365,10 @@ void plat_sdl_overlay_clear(void) int *dst = (int *)plat_sdl_overlay->pixels[0]; int v = 0x10801080; - for (; pixels > 0; dst += 4, pixels -= 2 * 4) + for (; pixels > 7; dst += 4, pixels -= 2 * 4) dst[0] = dst[1] = dst[2] = dst[3] = v; - for (; pixels > 0; dst++, pixels -= 2) + for (; pixels > 1; dst++, pixels -= 2) *dst = v; } -- 2.39.5