From 7d8ed9833e11d2bc7a4a48e018c74bd5a56ccde9 Mon Sep 17 00:00:00 2001 From: DRC Date: Fri, 7 Feb 2014 19:05:07 +0000 Subject: [PATCH] Further examination of the code reveals that this change is unnecessary. The histogram stores a count of each color in the image, so it will always contain at least one non-zero element, and thus the total can never be zero. Since the histogram is generated from the image data and not read from the header, there is no chance that header corruption would affect it. --- jquant2.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/jquant2.c b/jquant2.c index d9944705..9b060e57 100644 --- a/jquant2.c +++ b/jquant2.c @@ -513,8 +513,6 @@ compute_color (j_decompress_ptr cinfo, boxptr boxp, int icolor) } } - if (total == 0) - return; cinfo->colormap[0][icolor] = (JSAMPLE) ((c0total + (total>>1)) / total); cinfo->colormap[1][icolor] = (JSAMPLE) ((c1total + (total>>1)) / total); cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total>>1)) / total);