comparison os2/dw.c @ 1835:0123e8aec5b4

Fix crash when loading 8bpp images on OS/2 with GBM... We needed to allocate a 256 unit GBMRBG array not 1. Colors don't display properly with my test image, but it no longer crashes... must need to do something with the palette.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 08 Nov 2012 19:34:24 +0000
parents dc343df88ad8
children 692c3a18a112
comparison
equal deleted inserted replaced
1834:ca6ef85fffc5 1835:0123e8aec5b4
7140 } 7140 }
7141 7141
7142 /* if less than 24-bit, then have palette */ 7142 /* if less than 24-bit, then have palette */
7143 if(gbm.bpp < 24) 7143 if(gbm.bpp < 24)
7144 { 7144 {
7145 gbmrgb = alloca(sizeof(GBMRGB)); 7145 gbmrgb = alloca(sizeof(GBMRGB) * 256);
7146 /* Read the palette from the file */ 7146 /* Read the palette from the file */
7147 if((err = _gbm_read_palette(fd, z, &gbm, gbmrgb)) != 0) 7147 if((err = _gbm_read_palette(fd, z, &gbm, gbmrgb)) != 0)
7148 { 7148 {
7149 #ifdef DEBUG 7149 #ifdef DEBUG
7150 dw_debug("GBM: Read palette type %d \"%s\" %d %s\n", z, file, err, _gbm_err(err)); 7150 dw_debug("GBM: Read palette type %d \"%s\" %d %s\n", z, file, err, _gbm_err(err));