Skip to content

Commit

Permalink
Merge pull request #74 from mayeut/patch-1
Browse files Browse the repository at this point in the history
Update FROM_16_TO_8 macro not to raise UBSan error. Looks good. Thank you for the patch.
  • Loading branch information
mm2 committed May 3, 2016
2 parents 0e8234e + 6da55e0 commit e342f44
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lcms2_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@

// A fast way to convert from/to 16 <-> 8 bits
#define FROM_8_TO_16(rgb) (cmsUInt16Number) ((((cmsUInt16Number) (rgb)) << 8)|(rgb))
#define FROM_16_TO_8(rgb) (cmsUInt8Number) ((((rgb) * 65281 + 8388608) >> 24) & 0xFF)
#define FROM_16_TO_8(rgb) (cmsUInt8Number) ((((cmsUInt32Number)(rgb) * 65281U + 8388608U) >> 24) & 0xFFU)

// Code analysis is broken on asserts
#ifdef _MSC_VER
Expand Down

0 comments on commit e342f44

Please sign in to comment.