Lines 1-11
Link Here
|
1 |
--- src/pngxtern/pngxmem.c.orig 2015-04-22 09:07:30 UTC |
1 |
--- src/pngxtern/pngxmem.c.orig 2018-01-06 23:22:33 UTC |
2 |
+++ src/pngxtern/pngxmem.c |
2 |
+++ src/pngxtern/pngxmem.c |
3 |
@@ -34,7 +34,7 @@ pngx_malloc_rows_extended(png_structp pn |
3 |
@@ -35,7 +35,7 @@ pngx_malloc_rows_extended(png_structp pn |
4 |
png_error(png_ptr, "Missing IHDR"); |
|
|
5 |
row_size = png_get_rowbytes(png_ptr, info_ptr); |
4 |
row_size = png_get_rowbytes(png_ptr, info_ptr); |
6 |
/* libpng sets row_size to 0 when the width is too large to process. */ |
5 |
/* libpng sets row_size to 0 when the width is too large to process. */ |
7 |
- if (row_size == 0 || height > (pngx_alloc_size_t)(-1) / sizeof(png_bytep)) |
6 |
if (row_size == 0 || |
8 |
+ if (row_size == 0 || height > (pngx_alloc_size_t)(-1U) / sizeof(png_bytep)) |
7 |
- (pngx_alloc_size_t)height > (pngx_alloc_size_t)(-1) / sizeof(png_bytep)) |
|
|
8 |
+ (pngx_alloc_size_t)height > (pngx_alloc_size_t)(-1U) / sizeof(png_bytep)) |
9 |
png_error(png_ptr, "Can't handle exceedingly large image dimensions"); |
9 |
png_error(png_ptr, "Can't handle exceedingly large image dimensions"); |
10 |
if (row_size < min_row_size) |
10 |
if (row_size < min_row_size) |
11 |
row_size = min_row_size; |
11 |
row_size = min_row_size; |