Index: third_party/libtiff/tif_aux.c |
diff --git a/third_party/libtiff/tif_aux.c b/third_party/libtiff/tif_aux.c |
index 3ce3680ab2ae23cd86654230d47b2aaf81c18955..bc4ea0192815137f2d55031e70fbd0ee2d130d9e 100644 |
--- a/third_party/libtiff/tif_aux.c |
+++ b/third_party/libtiff/tif_aux.c |
@@ -69,7 +69,7 @@ _TIFFCheckRealloc(TIFF* tif, void* buffer, |
/* |
* XXX: Check for integer overflow. |
*/ |
- if (nmemb && elem_size && !_TIFFIfMultiplicationOverflow(nmemb, elem_size)) |
+ if (nmemb > 0 && elem_size > 0 && !_TIFFIfMultiplicationOverflow(nmemb, elem_size)) |
hong_zhang
2016/10/17 18:07:38
Hi, may I ask why? I thought tmsize_t is unsigned.
Tom Sepez
2016/10/17 18:20:04
nmemb is tmsize_t.
tmsize_t is TIFF_SSIZE_T at
h
|
cp = _TIFFrealloc(buffer, bytes); |
if (cp == NULL) { |