Add default cases for unknown format type
Some checks failed
CI / build-and-analyze (push) Failing after 50s
Some checks failed
CI / build-and-analyze (push) Failing after 50s
This commit is contained in:
4
Pix.c
4
Pix.c
@@ -352,6 +352,8 @@ static int isLittleEndian(void) {
|
|||||||
static void readData(const struct FormatInfo *format, void *data, uint32_t x,
|
static void readData(const struct FormatInfo *format, void *data, uint32_t x,
|
||||||
CgeColor *value, const CgeColor *palette, int flags) {
|
CgeColor *value, const CgeColor *palette, int flags) {
|
||||||
switch (format->type) {
|
switch (format->type) {
|
||||||
|
default: return;
|
||||||
|
|
||||||
case TYPE_INDEX:
|
case TYPE_INDEX:
|
||||||
*value = palette[readIndex(format, data, x)];
|
*value = palette[readIndex(format, data, x)];
|
||||||
break;
|
break;
|
||||||
@@ -381,6 +383,8 @@ static void writeData(const struct FormatInfo *format, void *data, uint32_t x,
|
|||||||
CgeColorToRGBA(value, &tmp);
|
CgeColorToRGBA(value, &tmp);
|
||||||
|
|
||||||
switch (format->type) {
|
switch (format->type) {
|
||||||
|
default: return;
|
||||||
|
|
||||||
case TYPE_INDEX:
|
case TYPE_INDEX:
|
||||||
writeIndex(format, data, x, bestPaletteIndex(&tmp, palette, format));
|
writeIndex(format, data, x, bestPaletteIndex(&tmp, palette, format));
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user