--- ghostscript.orig/base/gdevmpla.c
+++ ghostscript/base/gdevmpla.c
@@ -1954,12 +1954,12 @@
         int i;
         int j;
         intptr_t chunky_sraster;
-        intptr_t nbytes;
+        int64_t nbytes;
         byte **line_ptrs;
         byte *sbuf, *buf;
 
         chunky_sraster = sraster * (intptr_t)mdev->num_planar_planes;
-        if (check_64bit_multiply(height, chunky_sraster, (size_t *)&nbytes) != 0)
+        if (check_64bit_multiply(height, chunky_sraster, &nbytes) != 0)
             return gs_note_error(gs_error_undefinedresult);
         buf = gs_alloc_bytes(mdev->memory, nbytes, "mem_planar_strip_copy_rop(buf)");
         if (buf == NULL) {
@@ -2003,7 +2003,7 @@
         intptr_t i;
         intptr_t chunky_t_raster;
         int chunky_t_height;
-        intptr_t nbytes;
+        int64_t nbytes;
         byte **line_ptrs;
         byte *tbuf, *buf;
         gx_strip_bitmap newtex;
