diff options
author | Bill Allombert <ballombe@debian.org> | 2009-01-09 00:30:39 +0100 |
---|---|---|
committer | Christoph Brill <egore911@egore911.de> | 2009-01-09 00:30:39 +0100 |
commit | eb85e58b67b5a776b570129c1e8bb4ff8fcc0fda (patch) | |
tree | 99e14e3648cbcae6d32f478752643cc53f4e42d6 | |
parent | 5f58ccf21532a4bbb8c7d28efce935162ece85bf (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; |