summaryrefslogtreecommitdiff
path: root/pngset.c
diff options
context:
space:
mode:
authorGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2010-10-13 07:14:12 -0500
committerGlenn Randers-Pehrson <glennrp at users.sourceforge.net>2010-10-13 07:34:30 -0500
commitc0fc0dfc45137c6da4082da2846c6f69c14d5114 (patch)
tree36f93df10f820bf9a9bb690cf9cb7c13994f3f5e /pngset.c
parentf3eadd1737d11107ee55c3cc336e2fe16d087821 (diff)
downloadlibpng-c0fc0dfc45137c6da4082da2846c6f69c14d5114.tar.gz
[master] Check for out-of-range text compression mode in png_set_text().
Diffstat (limited to 'pngset.c')
-rw-r--r--pngset.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/pngset.c b/pngset.c
index 1f972c4ed..dad70661f 100644
--- a/pngset.c
+++ b/pngset.c
@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
- * Last changed in libpng 1.4.1 [February 25, 2010]
+ * Last changed in libpng 1.4.5 [October 13, 2010]
* Copyright (c) 1998-2010 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@@ -690,6 +690,13 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr, png_textp text_ptr,
if (text_ptr[i].key == NULL)
continue;
+ if (text_ptr[i].compression < PNG_TEXT_COMPRESSION_NONE ||
+ text_ptr[i].compression >= PNG_TEXT_COMPRESSION_LAST)
+ {
+ png_warning(png_ptr, "text compression mode is out of range");
+ continue;
+ }
+
key_len = png_strlen(text_ptr[i].key);
if (text_ptr[i].compression <= 0)