Add default cases for unknown format type
Some checks failed
CI / build-and-analyze (push) Failing after 50s

This commit is contained in:
2026-07-21 18:48:15 +03:00
parent 37bc5feaa4
commit 853295ee1f

4
Pix.c
View File

@@ -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;