Fixing bug causing crc error in region decoder

The error was caused by an incorrect crc value being calculated.
A crc value is calculated based on an images IDAT chunks
(png blocks of image data).
Since region decoder skips part of the data to decode a partial image,
the crc value will only be calculated with the partial data read,
not the entire data, resulting in an incorrect crc value.
The solution is to call png_opt_crc_finish() when checking the crc value
instead of png_crc_finish().
png_opt_crc_finish() treats the png_crc_error as a warning,
instead of an error, as png_crc_finish() does.
The case where there are multiple IDAT chunks was already handled
in png_read_IDAT_data() line 3994 in pngrutil.c.
When moving on to the next IDAT chunk it calls png_opt_crc_finish(),
as we may not have decoded the entire previous IDAT chunk
and there could be a crc error.
Since this particular image only has one IDAT chunk,
the first IDAT chunk's crc was being verified in png_read_finish_IDAT(),
which is called when we are done reading the image.
In this function I added a call to png_opt_crc_finish(), if png indexing
is supported, in opposed to png_crc_finish(), which fixed the error.

BUG:20224409

Change-Id: I97727f93f091f34700cea772bf796f168e85fc8f
1 file changed