From cb2273c41cf995cf1e32f62e1a7f2aea8e6fde4b Mon Sep 17 00:00:00 2001 From: Bill Allombert Date: Fri, 9 Jan 2009 00:51:28 +0100 Subject: [PATCH] 203_rdppm.dpatch Fix byte order issue with 16bit PPM/PGM files in rdppm.c --- rdppm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/rdppm.c b/rdppm.c index 1df35c1..309c943 100644 --- a/rdppm.c +++ b/rdppm.c @@ -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; -- cgit v1.2.3