Skip to content

Commit

Permalink
build(cute_png): update from upstream
Browse files Browse the repository at this point in the history
Fix the image size check on i386.
  • Loading branch information
dbohdan committed Jan 12, 2023
1 parent e88f637 commit 22a687f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions vendor/cute_png.h
Original file line number Diff line number Diff line change
Expand Up @@ -1108,7 +1108,7 @@ cp_image_t cp_load_png_mem(const void* png_data, int png_length)
h = cp_make32(ihdr + 4);
CUTE_PNG_CHECK(w >= 1, "invalid IHDR chunk found, image width was less than 1");
CUTE_PNG_CHECK(h >= 1, "invalid IHDR chunk found, image height was less than 1");
CUTE_PNG_CHECK(w * h * sizeof(cp_pixel_t) < INT_MAX, "image too large");
CUTE_PNG_CHECK((int64_t) w * h * sizeof(cp_pixel_t) < INT_MAX, "image too large");
pix_bytes = w * h * sizeof(cp_pixel_t);
img.w = w - 1;
img.h = h;
Expand Down Expand Up @@ -1327,7 +1327,7 @@ cp_indexed_image_t cp_load_indexed_png_mem(const void *png_data, int png_length)
// +1 for filter byte (which is dumb! just stick this at file header...)
w = cp_make32(ihdr) + 1;
h = cp_make32(ihdr + 4);
CUTE_PNG_CHECK(w * h * sizeof(uint8_t) < INT_MAX, "image too large");
CUTE_PNG_CHECK((int64_t) w * h * sizeof(uint8_t) < INT_MAX, "image too large");
pix_bytes = w * h * sizeof(uint8_t);
img.w = w - 1;
img.h = h;
Expand Down

0 comments on commit 22a687f

Please sign in to comment.