Browse Source

Fix application of internal palettes (and crashing on ARM)

tags/v1.8.0
Xerbo 4 years ago
parent
commit
afb0b9fc98
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      pngio.c

+ 2
- 2
pngio.c View File

@@ -254,12 +254,12 @@ int readPalette(char *filename, rgb_t **pixels) {
return 1; 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++){ for(int y = 0; y < nrow; y++){
crow[y] = (rgb_t *) malloc(sizeof(rgb_t) * IMG_WIDTH); crow[y] = (rgb_t *) malloc(sizeof(rgb_t) * IMG_WIDTH);


for(int x = 0; x < IMG_WIDTH; x++){ 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]; crow[y][x].r = crow[y][x].g = crow[y][x].b = prow[y][x];
else else
crow[y][x] = applyPalette(palette, prow[y][x]); crow[y][x] = applyPalette(palette, prow[y][x]);


Loading…
Cancel
Save