Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions png.c
Original file line number Diff line number Diff line change
Expand Up @@ -2699,7 +2699,7 @@ png_fixed(const png_struct *png_ptr, double fp, const char *text)
{
double r = floor(100000 * fp + .5);

if (r > 2147483647. || r < -2147483648.)
if (!(r >= -2147483648. && r <= 2147483647.))
png_fixed_error(png_ptr, text);

# ifndef PNG_ERROR_TEXT_SUPPORTED
Expand All @@ -2718,7 +2718,7 @@ png_fixed_ITU(const png_struct *png_ptr, double fp, const char *text)
{
double r = floor(10000 * fp + .5);

if (r > 2147483647. || r < 0)
if (!(r >= 0. && r <= 2147483647.))
png_fixed_error(png_ptr, text);

# ifndef PNG_ERROR_TEXT_SUPPORTED
Expand Down
2 changes: 1 addition & 1 deletion pngrtran.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ convert_gamma_value(png_struct *png_ptr, double output_gamma)
/* This preserves -1 and -2 exactly: */
output_gamma = floor(output_gamma + .5);

if (output_gamma > PNG_FP_MAX || output_gamma < PNG_FP_MIN)
if (!(output_gamma >= PNG_FP_MIN && output_gamma <= PNG_FP_MAX))
png_fixed_error(png_ptr, "gamma value");

return (png_fixed_point)output_gamma;
Expand Down