Return ImagingError_MemoryError

This commit is contained in:
Christoph Gohlke 2020-12-19 19:37:05 -08:00 committed by GitHub
parent 15dd7aef9f
commit fd14616dbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,7 +45,7 @@ ImagingHistogramNew(Imaging im)
/* Create histogram descriptor */
h = calloc(1, sizeof(struct ImagingHistogramInstance));
if (h == NULL) {
return NULL;
return (ImagingHistogram) ImagingError_MemoryError();
}
strncpy(h->mode, im->mode, IMAGING_MODE_LENGTH-1);
h->mode[IMAGING_MODE_LENGTH-1] = 0;