summaryrefslogtreecommitdiffstats
path: root/generic/tkImgPhoto.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2015-05-20 02:41:26 (GMT)
committerdgp <dgp@users.sourceforge.net>2015-05-20 02:41:26 (GMT)
commit511a4b5d5ef8ff90218dd3aa8c85478bd5f56a36 (patch)
treeff86d8f8fff8dc3559eef37260e888f9811adef0 /generic/tkImgPhoto.c
parentbc6490bcc6ca0eb4d50562f811e25949bda0701c (diff)
downloadtk-511a4b5d5ef8ff90218dd3aa8c85478bd5f56a36.zip
tk-511a4b5d5ef8ff90218dd3aa8c85478bd5f56a36.tar.gz
tk-511a4b5d5ef8ff90218dd3aa8c85478bd5f56a36.tar.bz2
Initialize memory to stop valgrind notices about conditionals dependent on
reads from uninit memory.
Diffstat (limited to 'generic/tkImgPhoto.c')
-rw-r--r--generic/tkImgPhoto.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index fcb6d2f..7fa894c 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -2075,6 +2075,9 @@ ToggleComplexAlphaIfNeeded(
*/
mPtr->flags &= ~COMPLEX_ALPHA;
+ if (c == NULL) {
+ return 0;
+ }
c += 3; /* Start at first alpha byte. */
for (; c < end; c += 4) {
if (*c && *c != 255) {