diff options
author | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2014-09-04 17:28:28 +0000 |
---|---|---|
committer | dcommander <dcommander@632fc199-4ca6-4c93-a231-07263d6284db> | 2014-09-04 17:28:28 +0000 |
commit | 3221037613a07088c592818b6cd26d2a36a775ce (patch) | |
tree | d49ee204499a6a76908bd1ad599e397dfc13db6a /jdcolor.c | |
parent | d2ec7e0b654d93540abe660d26bc1275115d776f (diff) |
When building libjpeg-turbo on Un*x systems, INT32 is usually typedef'ed to long, not int, so we need to specify an int pointer when doing a 4-byte write to the RGB565 output buffer. On little endian systems, this doesn't matter, but when you write a 32-bit int to a 64-bit long pointer address on a big endian system, you are writing to the upper 4 bytes, not the lower 4 bytes. NOTE: this will probably break on big endian systems that use 16-bit ints (are there any of those still around?)
This patch also removes an unneeded macro from jdmerge.c.
git-svn-id: svn://svn.code.sf.net/p/libjpeg-turbo/code/trunk@1402 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'jdcolor.c')
-rw-r--r-- | jdcolor.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -559,7 +559,7 @@ ycck_cmyk_convert (j_decompress_ptr cinfo, #define PACK_NEED_ALIGNMENT(ptr) (((size_t)(ptr)) & 3) -#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(INT32 *)(addr)) = pixels) +#define WRITE_TWO_ALIGNED_PIXELS(addr, pixels) ((*(int *)(addr)) = pixels) #define DITHER_565_R(r, dither) ((r) + ((dither) & 0xFF)) #define DITHER_565_G(g, dither) ((g) + (((dither) & 0xFF) >> 1)) |