Skip to content

Commit

Permalink
Set furthestV to first v in case compute_distances does not assign it
Browse files Browse the repository at this point in the history
  • Loading branch information
radarhere committed May 1, 2022
1 parent b299d7c commit 44494a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libImaging/Quant.c
Expand Up @@ -1577,6 +1577,7 @@ quantize2(
data.new.c.b = (int)(.5 + (double)mean[2] / (double)nPixels);
for (i = 0; i < nQuantPixels; i++) {
data.furthestDistance = 0;
data.furthestV = pixelData[0].v;
data.secondPixel = (i == 1) ? 1 : 0;
hashtable_foreach_update(h, compute_distances, &data);
p[i].v = data.furthestV;
Expand Down

0 comments on commit 44494a1

Please sign in to comment.