summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-11 10:56:00 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-11 10:56:00 (GMT)
commit0375a1fbe92d413821c252b7ccdb28ea608cf54c (patch)
treed320701266ac321c2fafb0616dc299a8512731c1 /generic
parent38b82010631e8ebde6b520bf6d5cd1c8265de2e0 (diff)
parent214d03616692872a0fd8ada460b01fd776307018 (diff)
downloadtk-0375a1fbe92d413821c252b7ccdb28ea608cf54c.zip
tk-0375a1fbe92d413821c252b7ccdb28ea608cf54c.tar.gz
tk-0375a1fbe92d413821c252b7ccdb28ea608cf54c.tar.bz2
Fix uninitialized variable in 16-bit PPM handling. [1632447] follow-up.
Diffstat (limited to 'generic')
-rw-r--r--generic/tkImgPPM.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c
index 79f7b25..6f084f0 100644
--- a/generic/tkImgPPM.c
+++ b/generic/tkImgPPM.c
@@ -603,7 +603,7 @@ StringReadPPM(
unsigned char *p;
unsigned int value;
- for (p = pixelPtr; count > 0; count--, p += 2) {
+ for (p = pixelPtr,count=nBytes; count > 1; count-=2, p += 2) {
value = ((unsigned int) p[0]) * 256 + ((unsigned int) p[1]);
value = value * 255 / maxIntensity;
p[0] = p[1] = (unsigned char) value;