mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Check return value of png_get_tRNS before using trans
png_get_tRNS may not set pointers if it fails.
This commit is contained in:
parent
1aa9e01419
commit
a9469c8ffb
1 changed files with 1 additions and 3 deletions
|
|
@ -999,9 +999,7 @@ static png_bytep *PNG_Read(
|
|||
// color is present on the image, the palette flag is disabled.
|
||||
if (usepal)
|
||||
{
|
||||
png_get_tRNS(png_ptr, png_info_ptr, &trans, &trans_num, &trans_values);
|
||||
|
||||
if (trans && trans_num > 0)
|
||||
if (png_get_tRNS(png_ptr, png_info_ptr, &trans, &trans_num, &trans_values) == PNG_INFO_tRNS)
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < trans_num; i++)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue