Skip to content

Commit

Permalink
https://github.com/ImageMagick/ImageMagick/issues/4841
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristy committed Feb 15, 2022
1 parent 1931a77 commit 0fec6dc
Showing 1 changed file with 16 additions and 22 deletions.
38 changes: 16 additions & 22 deletions coders/png.c
Expand Up @@ -2164,6 +2164,9 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,

/* To do: Read the tEXt/Creation Time chunk into the date:create property */

double
file_gamma;

Image
*image;

Expand All @@ -2173,7 +2176,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
num_text,
num_text_total,
num_passes,
number_colors,
number_colors = 0,
pass,
ping_bit_depth = 0,
ping_color_type = 0,
Expand All @@ -2184,9 +2187,6 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
ping_num_trans = 0,
unit_type = 0;

double
file_gamma;

MagickBooleanType
logging,
ping_found_cHRM,
Expand Down Expand Up @@ -2224,8 +2224,8 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
text;

png_uint_32
ping_height,
ping_width,
ping_height = 0,
ping_width = 0,
x_resolution,
y_resolution;

Expand All @@ -2235,28 +2235,22 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
Quantum
*volatile quantum_scanline;

ssize_t
y;

unsigned char
*p;

ssize_t
i,
x;

Quantum
*q;

size_t
length,
ping_rowbytes,
ping_rowbytes = 0,
row_offset;

ssize_t
j;
i,
j,
x,
y;

unsigned char
*p,
*ping_pixels;

#ifdef PNG_UNKNOWN_CHUNKS_SUPPORTED
Expand Down Expand Up @@ -2993,7 +2987,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
if (png_get_valid(ping,ping_info,PNG_INFO_PLTE))
{
png_colorp
palette;
palette = (png_colorp) NULL;

(void) png_get_PLTE(ping,ping_info,&palette,&number_colors);

Expand Down Expand Up @@ -3299,7 +3293,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
if ((int) ping_color_type == PNG_COLOR_TYPE_PALETTE)
{
png_colorp
palette;
palette = (png_colorp) NULL;

(void) png_get_PLTE(ping,ping_info,&palette,&number_colors);
image->colors=(size_t) number_colors;
Expand All @@ -3321,7 +3315,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
if ((int) ping_color_type == PNG_COLOR_TYPE_PALETTE)
{
png_colorp
palette;
palette = (png_colorp) NULL;

(void) png_get_PLTE(ping,ping_info,&palette,&number_colors);

Expand Down Expand Up @@ -4057,7 +4051,7 @@ static Image *ReadOnePNGImage(MngInfo *mng_info,
if (png_get_valid(ping,ping_info,PNG_INFO_PLTE))
{
png_colorp
plte;
plte = (png_colorp) NULL;

/*
Copy the PLTE to the object buffer.
Expand Down

0 comments on commit 0fec6dc

Please sign in to comment.