ref: df910b6ffff7ae54db6c2d2430709ebb911eda49
parent: 720e508d03bae14bf0e412abb37ad08ecde72e46
author: ray <ray@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue Aug 16 16:20:08 EDT 2005
Fix for shift right 32 bits of unsigned int being treated as shift right 0. git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@425 ded80894-8fb9-0310-811b-c03f3676ab4d
--- a/jbig2_huffman.c
+++ b/jbig2_huffman.c
@@ -148,7 +148,8 @@
}
hs->this_word = ws->get_next_word (ws, hs->offset);
hs->next_word = ws->get_next_word (ws, hs->offset + 4);
- hs->this_word = (hs->this_word << hs->offset_bits) |
+ if (hs->offset_bits > 0)
+ hs->this_word = (hs->this_word << hs->offset_bits) |
(hs->next_word >> (32 - hs->offset_bits));
}