SDL_image: xcf: Added an SDL_SetError when rejecting out-of-bounds tile data. (146bc)

From 146bc12c3efaf85bdd3289bd60100d428680ed7c Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Mon, 6 Apr 2026 14:58:56 -0400
Subject: [PATCH] xcf: Added an SDL_SetError when rejecting out-of-bounds tile
 data.

(cherry picked from commit 1aedddcbd205c4e1ea0f99fdb2c785acc8e2489b)
---
 src/IMG_xcf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/IMG_xcf.c b/src/IMG_xcf.c
index f0677462..4e9f1578 100644
--- a/src/IMG_xcf.c
+++ b/src/IMG_xcf.c
@@ -703,6 +703,7 @@ do_layer_surface(SDL_Surface * surface, SDL_RWops * src, xcf_header * head, xcf_
 
             /* Bounds check: reject layer if tile data exceeds buffer */
             if ((Uint64)ox * oy * hierarchy->bpp > (Uint64)(hierarchy->width * hierarchy->height * hierarchy->bpp)) {
+                SDL_SetError("Gimp image invalid tile");
                 free_xcf_tile(tile);
                 free_xcf_level(level);
                 free_xcf_hierarchy(hierarchy);