[devel] Check for out-of-range text compression mode in png_set_text().

This commit is contained in:
Glenn Randers-Pehrson
2010-10-13 06:55:30 -05:00
parent bc363eca41
commit e34f80e5aa
3 changed files with 13 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
* Last changed in libpng 1.5.0 [October 8, 2010]
* Last changed in libpng 1.5.0 [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.)
@@ -679,6 +679,12 @@ png_set_text_2(png_structp png_ptr, png_infop info_ptr,
key_len = png_strlen(text_ptr[i].key);
if (text_ptr[i].compression >= PNG_TEXT_COMPRESSION_LAST)
{
png_warning(png_ptr, "text compression mode is out of range");
continue;
}
if (text_ptr[i].compression <= 0)
{
lang_len = 0;