[libpng17] Delay calling png_init_filter_functions() until a row with nonzero

filter is found.
This commit is contained in:
Glenn Randers-Pehrson
2013-08-20 21:28:19 -05:00
parent 83f1287c02
commit 157e0649e0
3 changed files with 13 additions and 5 deletions

View File

@@ -3882,10 +3882,13 @@ png_read_filter_row(png_structrp pp, png_row_infop row_info, png_bytep row,
* PNG_FILTER_OPTIMIZATIONS to a function that overrides the generic
* implementations. See png_init_filter_functions above.
*/
if (pp->read_filter[0] == NULL)
png_init_filter_functions(pp);
if (filter > PNG_FILTER_VALUE_NONE && filter < PNG_FILTER_VALUE_LAST)
{
if (pp->read_filter[0] == NULL)
png_init_filter_functions(pp);
pp->read_filter[filter-1](row_info, row, prev_row);
}
}
#ifdef PNG_SEQUENTIAL_READ_SUPPORTED