diff options
author | Bill Allombert <ballombe@debian.org> | 2009-01-09 00:51:28 +0100 |
---|---|---|
committer | Christoph Brill <egore911@egore911.de> | 2009-01-09 00:51:28 +0100 |
commit | cb2273c41cf995cf1e32f62e1a7f2aea8e6fde4b (patch) | |
tree | 99e14e3648cbcae6d32f478752643cc53f4e42d6 | |
parent | 9e4f6f15a8170cc7260bb51cb4d9a474a39a51d0 (diff) |
[PATCH] 203_rdppm.dpatch
Fix byte order issue with 16bit PPM/PGM files in rdppm.c
-rw-r--r-- | rdppm.c | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -250,8 +250,8 @@ get_word_gray_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) bufferptr = source->iobuffer; for (col = cinfo->image_width; col > 0; col--) { register int temp; - temp = UCH(*bufferptr++); - temp |= UCH(*bufferptr++) << 8; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); *ptr++ = rescale[temp]; } return 1; @@ -274,14 +274,14 @@ get_word_rgb_row (j_compress_ptr cinfo, cjpeg_source_ptr sinfo) bufferptr = source->iobuffer; for (col = cinfo->image_width; col > 0; col--) { register int temp; - temp = UCH(*bufferptr++); - temp |= UCH(*bufferptr++) << 8; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); *ptr++ = rescale[temp]; - temp = UCH(*bufferptr++); - temp |= UCH(*bufferptr++) << 8; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); *ptr++ = rescale[temp]; - temp = UCH(*bufferptr++); - temp |= UCH(*bufferptr++) << 8; + temp = UCH(*bufferptr++) << 8; + temp |= UCH(*bufferptr++); *ptr++ = rescale[temp]; } return 1; |