diff options
author | Ian C <ianc@noddybox.co.uk> | 2005-05-12 23:21:03 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2005-05-12 23:21:03 +0000 |
commit | 46e4cd640c247ace1ab16c63b157c0608161806e (patch) | |
tree | ab6a9f26ebaf96cc5e9cc5fc758b4807e9f78849 /Xbit.c | |
parent | 7fbd8d53b1932e40676a120cfd84868f3758465b (diff) |
Fixed problem with disabling shared memory XImage
Diffstat (limited to 'Xbit.c')
-rw-r--r-- | Xbit.c | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -205,7 +205,20 @@ XImage *CreateXImage(void) if (!use_shm) { - if (!(p=malloc(current->pw*current->ph*(vinfo.bits_per_rgb/8)))) + switch(vinfo.depth) + { + case 8: + p=malloc(current->pw*current->ph*1); + break; + case 16: + p=malloc(current->pw*current->ph*2); + break; + default: + p=malloc(current->pw*current->ph*4); + break; + } + + if (!p) { fprintf(stderr,"%s(%d) : FATAL:%s\n",__FILE__,__LINE__, "Couldn't malloc() XImage data"); |