mirror of
https://github.com/fltk/fltk.git
synced 2026-06-06 00:22:42 +08:00
Fix STR #2637, part 2: accessing pixel values beyond array bounds. 64-bit
converters to X image formats would access one more pixel per line for images with odd widths. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8731 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -297,13 +297,15 @@ static void rrr_converter(const uchar *from, uchar *to, int w, int delta) {
|
||||
# if WORDS_BIGENDIAN
|
||||
# define INNARDS32(f) \
|
||||
U64 *t = (U64*)to; \
|
||||
int w1 = (w+1)/2; \
|
||||
for (; w1--; from += delta) {U64 i = f; from += delta; *t++ = (i<<32)|(f);}
|
||||
int w1 = w/2; \
|
||||
for (; w1--; from += delta) {U64 i = f; from += delta; *t++ = (i<<32)|(f);} \
|
||||
if (w&1) *t++ = (U64)(f)<<32;
|
||||
# else
|
||||
# define INNARDS32(f) \
|
||||
U64 *t = (U64*)to; \
|
||||
int w1 = (w+1)/2; \
|
||||
for (; w1--; from += delta) {U64 i=f; from+= delta; *t++ = ((U64)(f)<<32)|i;}
|
||||
int w1 = w/2; \
|
||||
for (; w1--; from += delta) {U64 i = f; from += delta; *t++ = ((U64)(f)<<32)|i;} \
|
||||
if (w&1) *t++ = (U64)(f);
|
||||
# endif
|
||||
# else
|
||||
# define STORETYPE U32
|
||||
|
||||
Reference in New Issue
Block a user