From 853295ee1fa2993956f0f009889777dc8dda08ea Mon Sep 17 00:00:00 2001 From: Mikhail Romanko Date: Tue, 21 Jul 2026 18:48:15 +0300 Subject: [PATCH] Add default cases for unknown format type --- Pix.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Pix.c b/Pix.c index 780359e..e99870b 100644 --- a/Pix.c +++ b/Pix.c @@ -352,6 +352,8 @@ static int isLittleEndian(void) { static void readData(const struct FormatInfo *format, void *data, uint32_t x, CgeColor *value, const CgeColor *palette, int flags) { switch (format->type) { + default: return; + case TYPE_INDEX: *value = palette[readIndex(format, data, x)]; break; @@ -381,6 +383,8 @@ static void writeData(const struct FormatInfo *format, void *data, uint32_t x, CgeColorToRGBA(value, &tmp); switch (format->type) { + default: return; + case TYPE_INDEX: writeIndex(format, data, x, bestPaletteIndex(&tmp, palette, format)); break;