X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00cb87b4be158b91f91dc7a7026bfd6665e7560f..3f93a7508ea292a0ba836eefcccf20a716eaf135:/src/tiff/tif_dirread.c diff --git a/src/tiff/tif_dirread.c b/src/tiff/tif_dirread.c index 4c4991a62a..96ecfe59ed 100644 --- a/src/tiff/tif_dirread.c +++ b/src/tiff/tif_dirread.c @@ -67,7 +67,7 @@ CheckMalloc(TIFF* tif, size_t nmemb, size_t elem_size, const char* what) char *cp = NULL; tsize_t bytes = nmemb * elem_size; - if (elem_size && bytes / elem_size == nmemb) + if (nmemb && elem_size && bytes / elem_size == nmemb) cp = (char*)_TIFFmalloc(bytes); if (cp == NULL)