From: kub Date: Fri, 4 Mar 2022 19:39:44 +0000 (+0000) Subject: fix a buffer overflow X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d07718a03be25075abef1888b836dfb77e1c83a0;p=libpicofe.git fix a buffer overflow --- 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; }