From afb0b9fc98411ecff6656af7fe0773a7c10c26d6 Mon Sep 17 00:00:00 2001 From: Xerbo Date: Fri, 12 Jun 2020 20:25:26 +0100 Subject: [PATCH] Fix application of internal palettes (and crashing on ARM) --- pngio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pngio.c b/pngio.c index 7e029b3..8c146c2 100644 --- a/pngio.c +++ b/pngio.c @@ -254,12 +254,12 @@ int readPalette(char *filename, rgb_t **pixels) { return 1; } -void prow2crow(float **prow, int nrow, char palette, rgb_t **crow){ +void prow2crow(float **prow, int nrow, char *palette, rgb_t **crow){ for(int y = 0; y < nrow; y++){ crow[y] = (rgb_t *) malloc(sizeof(rgb_t) * IMG_WIDTH); for(int x = 0; x < IMG_WIDTH; x++){ - if(palette == NULL) + if(*palette == NULL) crow[y][x].r = crow[y][x].g = crow[y][x].b = prow[y][x]; else crow[y][x] = applyPalette(palette, prow[y][x]);