diff options
Diffstat (limited to 'src/image.c')
-rw-r--r-- | src/image.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/image.c b/src/image.c index d2a71637fed..bf7daa24da1 100644 --- a/src/image.c +++ b/src/image.c @@ -3586,11 +3586,7 @@ xpm_load (struct frame *f, struct image *img) #endif /* HAVE_NTGUI */ /* Remember allocated colors. */ - if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *img->colors - < attrs.nalloc_pixels) - memory_full (SIZE_MAX); - img->colors = (unsigned long *) xmalloc (img->ncolors - * sizeof *img->colors); + img->colors = xnmalloc (attrs.nalloc_pixels, sizeof *img->colors); img->ncolors = attrs.nalloc_pixels; for (i = 0; i < attrs.nalloc_pixels; ++i) { |