changeset 2411:5db33d37cc1a

iOS: Fix crashes when creating pixmaps, pixmaps still need tons of work. But this prevents the immediate crash on creation.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 30 Mar 2021 16:17:39 +0000
parents 0286ac44d347
children 3b59cbd26fab
files ios/dw.m
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/ios/dw.m	Tue Mar 30 08:28:35 2021 +0000
+++ b/ios/dw.m	Tue Mar 30 16:17:39 2021 +0000
@@ -6466,8 +6466,8 @@
     if((pixmap = calloc(1,sizeof(struct _hpixmap))))
     {
         CGColorSpaceRef rgb = CGColorSpaceCreateDeviceRGB();
-        CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, calloc(width*height, 4), width*height*32, NULL);
-        CGImageRef image = CGImageCreate(width, height, 8, 32, 32 * width,
+        CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, calloc(width*height, 4), width*height*4, NULL);
+        CGImageRef image = CGImageCreate(width, height, 8, 32, 4 * width,
                                          rgb, kCGBitmapByteOrderDefault | kCGImageAlphaLast,
                                          provider, NULL, false, kCGRenderingIntentDefault);
         pixmap->width = width;