[QuantOctree.c] Remove erroneous attempt to average over an empty range.

This commit is contained in:
Thomas Köppe 2018-06-21 12:45:54 +01:00
parent 968c2cf3c9
commit 6c0d1e0f15

View File

@ -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;