summaryrefslogtreecommitdiff
path: root/src/gd_topal.c
diff options
context:
space:
mode:
authorpierre <none@none>2006-04-05 15:51:53 +0000
committerpierre <none@none>2006-04-05 15:51:53 +0000
commit0a3439a3e7f6be09b8a5b90ea1b19b3a6090ec53 (patch)
tree37fbdf92d74507ca5aa3491e753a8d3b86b2b4cc /src/gd_topal.c
parent480330b083f8e4e5f08d99510179482af6e5b829 (diff)
downloadlibgd-0a3439a3e7f6be09b8a5b90ea1b19b3a6090ec53.tar.gz
- sync to 2.0.23
Diffstat (limited to 'src/gd_topal.c')
-rw-r--r--src/gd_topal.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/gd_topal.c b/src/gd_topal.c
index 8efce1e..6092506 100644
--- a/src/gd_topal.c
+++ b/src/gd_topal.c
@@ -757,15 +757,18 @@ LOCAL (void)
cinfo->colormap[2][icolor] = (JSAMPLE) ((c2total + (total >> 1)) / total);
#else
/* 2.0.16: Paul den Dulk found an occasion where total can be 0 */
- if (count) {
- im->red[icolor] = (int) ((c0total + (total >> 1)) / total);
- im->green[icolor] = (int) ((c1total + (total >> 1)) / total);
- im->blue[icolor] = (int) ((c2total + (total >> 1)) / total);
- } else {
- im->red[icolor] = 255;
- im->green[icolor] = 255;
- im->blue[icolor] = 255;
- }
+ if (count)
+ {
+ im->red[icolor] = (int) ((c0total + (total >> 1)) / total);
+ im->green[icolor] = (int) ((c1total + (total >> 1)) / total);
+ im->blue[icolor] = (int) ((c2total + (total >> 1)) / total);
+ }
+ else
+ {
+ im->red[icolor] = 255;
+ im->green[icolor] = 255;
+ im->blue[icolor] = 255;
+ }
#endif
}