summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-11 10:55:12 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2013-11-11 10:55:12 (GMT)
commit214d03616692872a0fd8ada460b01fd776307018 (patch)
treefb93432d7948bb60283dbea2190dd3855912b9da
parent6d173aa6be98d083b288206ad2c036bc37799c89 (diff)
downloadtk-214d03616692872a0fd8ada460b01fd776307018.zip
tk-214d03616692872a0fd8ada460b01fd776307018.tar.gz
tk-214d03616692872a0fd8ada460b01fd776307018.tar.bz2
Fix uninitialized variable in 16-bit PPM handling. [1632447] follow-up.
-rw-r--r--generic/tkImgPPM.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/generic/tkImgPPM.c b/generic/tkImgPPM.c
index d71db25..ddd16b2 100644
--- a/generic/tkImgPPM.c
+++ b/generic/tkImgPPM.c
@@ -595,7 +595,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;