Fix overflow when shifting `u8`s

This commit is contained in:
David Wendt 2020-01-24 14:43:49 -05:00
parent 3d6b00c1e4
commit 7d225f8b55
1 changed files with 1 additions and 1 deletions

View File

@ -165,7 +165,7 @@ impl TextFormat {
"color", "color",
self.color self.color
.clone() .clone()
.map(|v| ((v.r << 16) + (v.g << 8) + v.b).into()) .map(|v| (((v.r as u32) << 16) + ((v.g as u32) << 8) + v.b as u32).into())
.unwrap_or(Value::Null), .unwrap_or(Value::Null),
avm1, avm1,
uc, uc,