ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bmpfile.c
(Generate patch)

Comparing ray/src/common/bmpfile.c (file contents):
Revision 2.16 by schorsch, Thu Mar 10 01:49:00 2016 UTC vs.
Revision 2.17 by schorsch, Thu Mar 10 23:18:59 2016 UTC

# Line 548 | Line 548 | BMPmappedHeader(int xr, int yr, int infolen, int ncolo
548                  n = 8;
549          else
550                  return NULL;
551        /* XXX VC warns about 32 bit shift coerced to 64 bit */
551          hdr = (BMPHeader *)malloc(sizeof(BMPHeader) +
552 <                                        sizeof(RGBquad)*(1<<n) -
552 >                                        sizeof(RGBquad)*((size_t)1<<n) -
553                                          sizeof(hdr->palette) +
554                                          infolen);
555          if (hdr == NULL)
# Line 564 | Line 563 | BMPmappedHeader(int xr, int yr, int infolen, int ncolo
563          hdr->nColors = ncolors;
564          hdr->impColors = 0;                     /* says all colors important */
565          hdr->infoSiz = infolen;
566 <        /* XXX VC warns about 32 bit shift coerced to 64 bit */
568 <        memset((void *)hdr->palette, 0, sizeof(RGBquad)*(1<<n) + infolen);
566 >        memset((void *)hdr->palette, 0, sizeof(RGBquad)*((size_t)1<<n) + infolen);
567          for (n = ncolors; n--; )
568                  hdr->palette[n].r = hdr->palette[n].g =
569                          hdr->palette[n].b = n*255/(ncolors-1);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines