Commit eb9108ce authored by Tim-Philipp Müller's avatar Tim-Philipp Müller 🐠

orcbytecode: Fix parsing of 32 bit values from bytecode as well

The shift by 24 bits has to be casted as well, otherwise we
shift into the sign bit which causes undefined behaviour.

See https://bugzilla.gnome.org/show_bug.cgi?id=698520
parent 3f98bc77
......@@ -349,9 +349,9 @@ orc_bytecode_parse_get_uint32 (OrcBytecodeParse *parse)
{
orc_uint32 value;
value = orc_bytecode_parse_get_byte (parse);
value |= orc_bytecode_parse_get_byte (parse) << 8;
value |= orc_bytecode_parse_get_byte (parse) << 16;
value |= orc_bytecode_parse_get_byte (parse) << 24;
value |= ((orc_uint32)orc_bytecode_parse_get_byte (parse)) << 8;
value |= ((orc_uint32)orc_bytecode_parse_get_byte (parse)) << 16;
value |= ((orc_uint32)orc_bytecode_parse_get_byte (parse)) << 24;
return value;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment