X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/00cb87b4be158b91f91dc7a7026bfd6665e7560f..e319bb30f7e88242f56144fcc279b57047566a6b:/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)