From 1aedddcbd205c4e1ea0f99fdb2c785acc8e2489b 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.
---
src/IMG_xcf.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/IMG_xcf.c b/src/IMG_xcf.c
index 77586626..57679f8f 100644
--- a/src/IMG_xcf.c
+++ b/src/IMG_xcf.c
@@ -803,6 +803,7 @@ do_layer_surface(SDL_Surface *surface, SDL_IOStream *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);