mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-26 17:24:31 +03:00
[QuantOctree.c] Remove erroneous attempt to average over an empty range.
This commit is contained in:
parent
968c2cf3c9
commit
6c0d1e0f15
|
@ -259,6 +259,10 @@ subtract_color_buckets(ColorCube cube, ColorBucket buckets, long nBuckets) {
|
|||
Pixel p;
|
||||
for (i=0; i<nBuckets; i++) {
|
||||
subtrahend = &buckets[i];
|
||||
|
||||
// If the subtrahend contains no buckets, there is nothing to subtract.
|
||||
if (subtrahend->count == 0) continue;
|
||||
|
||||
avg_color_from_color_bucket(subtrahend, &p);
|
||||
minuend = color_bucket_from_cube(cube, &p);
|
||||
minuend->count -= subtrahend->count;
|
||||
|
|
Loading…
Reference in New Issue
Block a user