diff options
author | ppatience0 <ppatience0@gmail.com> | 2013-07-03 21:08:13 -0400 |
---|---|---|
committer | ppatience0 <ppatience0@gmail.com> | 2013-07-03 21:08:13 -0400 |
commit | cbf6be5baed9eced05c75d486f82293527b4b86f (patch) | |
tree | c1f3a0d43da76741dfe501013445c670eb8fa773 | |
parent | e6b647e8ec1e2c4bc979541179ba093ba1cc5291 (diff) |
tif: initialize max to one instead of zero for palette rescaling in case all values are zero.
-rw-r--r-- | sys/src/cmd/jpg/readtif.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/jpg/readtif.c b/sys/src/cmd/jpg/readtif.c index 9d2f926e2..51b15424d 100644 --- a/sys/src/cmd/jpg/readtif.c +++ b/sys/src/cmd/jpg/readtif.c @@ -1290,7 +1290,7 @@ paldecode(Tif *t, Rawimage *im, uchar *data) pmask = (1 << t->depth) - 1; xmask = 7 >> log2[t->depth]; - for(i = max = 0; i < t->ncolor; i++) { + for(i = 0, max = 1; i < t->ncolor; i++) { if(t->color[i] > max) max = t->color[i]; } |