From 70298d3be948e4245e2f24481b33d8d877c45e1d Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Wed, 7 Aug 2024 06:38:46 +1000 Subject: [PATCH] Fix undefined variable --- src/libImaging/Quant.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libImaging/Quant.c b/src/libImaging/Quant.c index 55b5e7a55..a489a882d 100644 --- a/src/libImaging/Quant.c +++ b/src/libImaging/Quant.c @@ -314,8 +314,9 @@ test_sorted(PixelList *pl[3]) { for (i = 0; i < 3; i++) { l = 256; for (t = pl[i]; t; t = t->next[i]) { - if (l < t->p.a.v[i]) + if (l < t->p.a.v[i]) { return 0; + } l = t->p.a.v[i]; } } @@ -1009,7 +1010,8 @@ compute_palette_from_median_cut( uint32_t nPixels, HashTable *medianBoxHash, Pixel **palette, - uint32_t nPaletteEntries + uint32_t nPaletteEntries, + BoxNode *root ) { uint32_t i; uint32_t paletteEntry; @@ -1382,7 +1384,9 @@ quantize( fflush(stdout); timer = clock(); #endif - if (!compute_palette_from_median_cut(pixelData, nPixels, h, &p, nPaletteEntries)) { + if (!compute_palette_from_median_cut( + pixelData, nPixels, h, &p, nPaletteEntries, root + )) { goto error_3; } #ifdef DEBUG