[devel] Revised png_check_IHDR()

to eliminate bogus complaint about filter_type.
This commit is contained in:
Glenn Randers-Pehrson
2009-09-25 11:45:42 -05:00
parent 6564abbf26
commit 7ec330ddeb
4 changed files with 28 additions and 17 deletions

19
png.c
View File

@@ -887,17 +887,22 @@ png_check_IHDR(png_structp png_ptr,
if (filter_type != PNG_FILTER_TYPE_BASE)
{
if (!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
if (!((png_ptr->mng_features_permitted & PNG_FLAG_MNG_FILTER_64) &&
(filter_type == PNG_INTRAPIXEL_DIFFERENCING) &&
((png_ptr->mode&PNG_HAVE_PNG_SIGNATURE) == 0) &&
((png_ptr->mode & PNG_HAVE_PNG_SIGNATURE) == 0) &&
(color_type == PNG_COLOR_TYPE_RGB ||
color_type == PNG_COLOR_TYPE_RGB_ALPHA)))
png_warning(png_ptr, "Unknown filter method in IHDR");
error = 1;
}
{
png_warning(png_ptr, "Unknown filter method in IHDR");
error = 1;
}
if (png_ptr->mode&PNG_HAVE_PNG_SIGNATURE)
png_warning(png_ptr, "Invalid filter method in IHDR");
if (png_ptr->mode & PNG_HAVE_PNG_SIGNATURE)
{
png_warning(png_ptr, "Invalid filter method in IHDR");
error = 1;
}
}
#else
if (filter_type != PNG_FILTER_TYPE_BASE)