Bug 689870

Summary: unsigned fields read as int
Product: jbig2dec Reporter: Ralph Giles <ralph.giles>
Component: ParsingAssignee: Henry Stiles <henry.stiles>
Status: RESOLVED FIXED    
Severity: normal CC: christinedelight.top85, masaki.ushizaka
Priority: P4    
Version: master   
Hardware: PC   
OS: Linux   
Customer: Word Size: ---

Description Ralph Giles 2008-05-26 12:16:02 UTC
In debugging bug 689841, I noticed the data_length field in the segment header
was getting sign extended on x86_64. This is because jbig2_get_int32 is
returning a signed integer even though the field is a uint32_t in the format. So
we've been mishandling any segment length over 2^31, it just hasn't come up before.

The code should be reviewed and either change jbig2_get_int32 to
jbig2_get_uint32 or add a second call, depending on how many signed fields we
need to read.