diff options
author | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2010-10-13 07:14:12 -0500 |
---|---|---|
committer | Glenn Randers-Pehrson <glennrp at users.sourceforge.net> | 2010-10-13 07:34:30 -0500 |
commit | c0fc0dfc45137c6da4082da2846c6f69c14d5114 (patch) | |
tree | 36f93df10f820bf9a9bb690cf9cb7c13994f3f5e /pngset.c | |
parent | f3eadd1737d11107ee55c3cc336e2fe16d087821 (diff) | |
download | libpng-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.c | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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) |