SDL_image: Fixed bounds check on innerSrc

From b64804ef691a8de2acfc0db107624124773f1907 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 25 May 2022 10:38:55 -0700
Subject: [PATCH] Fixed bounds check on innerSrc

---
 IMG_pcx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/IMG_pcx.c b/IMG_pcx.c
index 09b9a99..59af592 100644
--- a/IMG_pcx.c
+++ b/IMG_pcx.c
@@ -227,7 +227,7 @@ SDL_Surface *IMG_LoadPCX_RW(SDL_RWops *src)
                 Uint8 *dst = row + plane;
                 Uint8 *end2= row + surface->pitch;
                 for ( x = 0; x < width; x++ ) {
-                    if ( innerSrc >= end1 || dst >= end2 ) {
+                    if ( (innerSrc + x) >= end1 || dst >= end2 ) {
                         error = "decoding out of bounds (corrupt?)";
                         goto done;
                     }