diff options
author | Erik Reckase <e.reckase@gmail.com> | 2010-05-10 22:05:47 +0000 |
---|---|---|
committer | Scott Draves <spot@draves.org> | 2015-02-15 12:20:12 -0500 |
commit | f0d93b3b51baffcd90062272db91d94c17199e9a (patch) | |
tree | b2f4474d143bbccddc5fcc5df6f561abe48ce17b /src | |
parent | 1c335721c262a3c9afed11be48a442276dd11b2b (diff) | |
download | pucket-f0d93b3b51baffcd90062272db91d94c17199e9a.tar.gz pucket-f0d93b3b51baffcd90062272db91d94c17199e9a.tar.bz2 pucket-f0d93b3b51baffcd90062272db91d94c17199e9a.zip |
if a pixel had accumulated color (0,0,0) and >0 density, a divide by 0 would take place.
git-svn-id: https://flam3.googlecode.com/svn/trunk@12 77852712-ef1d-11de-8684-7d64432d61a3
Diffstat (limited to 'src')
-rw-r--r-- | src/palettes.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/palettes.c b/src/palettes.c index 64122a3..c5090ee 100644 --- a/src/palettes.c +++ b/src/palettes.c @@ -288,7 +288,7 @@ void flam3_calc_newrgb(double *cbuf, double ls, double highpow, double *newrgb) double a, maxa=-1.0, maxc=0; double adjhlp; - if (ls==0.0) { + if (ls==0.0 || (cbuf[0]==0.0 && cbuf[1]==0.0 && cbuf[2]==0.0)) { newrgb[0] = 0.0; newrgb[1] = 0.0; newrgb[2] = 0.0; @@ -303,7 +303,7 @@ void flam3_calc_newrgb(double *cbuf, double ls, double highpow, double *newrgb) maxc = cbuf[rgbi]/PREFILTER_WHITE; } } - + /* If a channel is saturated and we have a non-negative highlight power */ /* modify the color to prevent hue shift */ if (maxa>255 && highpow>=0.0) { |