]> git.saurik.com Git - wxWidgets.git/blobdiff - src/tiff/tif_dirread.c
Fixed caret droppings left when scrolling
[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)