summaryrefslogtreecommitdiff
path: root/pngwutil.c
diff options
context:
space:
mode:
Diffstat (limited to 'pngwutil.c')
-rw-r--r--pngwutil.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pngwutil.c b/pngwutil.c
index bc6c98669..182f8db2f 100644
--- a/pngwutil.c
+++ b/pngwutil.c
@@ -1285,7 +1285,7 @@ png_check_keyword(png_structp png_ptr, png_charp key, png_charpp new_key)
{
png_warning(png_ptr, "trailing spaces removed from keyword");
- while (*kp == ' ')
+ while (key_len && *kp == ' ')
{
*(kp--) = '\0';
key_len--;