setByteArray(): fix previous commit

This commit is contained in:
Even Rouault 2019-08-16 19:59:18 +02:00
parent 1302ffb350
commit 1a11c9df6e
No known key found for this signature in database
GPG Key ID: 33EBBFC47B3DD87D

View File

@ -47,7 +47,7 @@ setByteArray(void** vpp, void* vp, size_t nmemb, size_t elem_size)
}
if (vp) {
tmsize_t bytes = _TIFFMultiplySSize(NULL, nmemb, elem_size, NULL);
if (elem_size)
if (bytes)
*vpp = (void*) _TIFFmalloc(bytes);
if (*vpp)
_TIFFmemcpy(*vpp, vp, bytes);