]> git.saurik.com Git - wxWidgets.git/blobdiff - src/tiff/tif_dirread.c
[ 1509599 ] 'Split pickers page in widgets sample' with more icons and rebaking.
[wxWidgets.git] / src / tiff / tif_dirread.c
index 4c4991a62a6f09c8a76652f00a8d0d269dac2f09..96ecfe59ed0d3078b7b2a8684c7d954c92f2d6c1 100644 (file)
@@ -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)