Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Apr 3, 2021
1 parent 0f40ca2 commit f2a5d86
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions coders/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -2053,11 +2053,11 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
*volatile pixel_info;

png_bytep
ping_trans_alpha;
ping_trans_alpha = NULL;

png_color_16p
ping_background,
ping_trans_color;
ping_background = (png_color_16p) NULL,
ping_trans_color = (png_color_16p) NULL;

png_info
*end_info,
Expand Down Expand Up @@ -2952,7 +2952,8 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
}
#endif /* PNG_READ_bKGD_SUPPORTED */

if (png_get_valid(ping,ping_info,PNG_INFO_tRNS))
if ((png_get_valid(ping,ping_info,PNG_INFO_tRNS)) &&
(ping_trans_color != (png_color_16p) NULL))
{
/*
Image has a tRNS chunk.
Expand Down

0 comments on commit f2a5d86

Please sign in to comment.