libpng: Patch out 100% opaque optimization.

This optimization seems to work fine if you want RGB, but if you want
RGBA, it forgets to add the fixed values back.

See #14628.
This commit is contained in:
Unknown W. Brackets 2021-08-08 12:23:51 -07:00
parent 9c49fba595
commit cc04523985
2 changed files with 4 additions and 3 deletions

View File

@ -3997,8 +3997,7 @@ png_image_read_direct(png_voidp argument)
# endif
/* This is actually an internal error. */
// HACK to prevent crash: See issue #14628
// affirm(out_format == format /* else unimplemented transformations */);
affirm(out_format == format /* else unimplemented transformations */);
}
/* Now read the rows. If do_local_compose is set then it is necessary to use

View File

@ -6603,7 +6603,9 @@ check_tRNS_for_alpha(png_structrp png_ptr)
}
/* All entries opaque; remove the tRNS data: */
png_ptr->num_trans = 0U;
// TODO: This optimization doesn't handle adding it back if RGBA is requested.
// See PPSSPP issue #14628.
//png_ptr->num_trans = 0U;
}
#endif /* READ_tRNS */