Commit df934b472 for imagemagick.org
commit df934b4721173f8dda33c6d007f9811669640e86
Author: Dirk Lemstra <dirk@lemstra.org>
Date: Sat Mar 7 10:14:57 2026 +0100
Added extra check to prevent out of bounds write when color reduction fails (GHSA-49hx-7656-jpg3)
diff --git a/coders/sixel.c b/coders/sixel.c
index 2eddc7ce8..2b7514137 100644
--- a/coders/sixel.c
+++ b/coders/sixel.c
@@ -1399,6 +1399,8 @@ static MagickBooleanType WriteSIXELImage(const ImageInfo *image_info,
image->colormap[opacity].blue=image->transparent_color.blue;
}
}
+ if (image->colors > SIXEL_PALETTE_MAX)
+ return(MagickFalse);
/*
SIXEL header.
*/