# HG changeset patch # User alfadur # Date 1564789879 -10800 # Node ID 0f734fa371e1242834f3a1171b906516d5bbda3b # Parent 3bb3fe1cf87c2f1780d9a8f5b96aa335487689f3 fix buffer sizes diff -r 3bb3fe1cf87c -r 0f734fa371e1 rust/hwphysics/src/common.rs --- a/rust/hwphysics/src/common.rs Sat Aug 03 02:14:07 2019 +0300 +++ b/rust/hwphysics/src/common.rs Sat Aug 03 02:51:19 2019 +0300 @@ -114,7 +114,7 @@ impl GearDataLookup { pub fn new() -> Self { Self { - lookup: Vec::with_capacity(u16::max_value() as usize).into_boxed_slice() + lookup: vec![LookupEntry::default(); u16::max_value() as usize].into_boxed_slice(), } } } diff -r 3bb3fe1cf87c -r 0f734fa371e1 rust/lib-hedgewars-engine/src/render/gear.rs --- a/rust/lib-hedgewars-engine/src/render/gear.rs Sat Aug 03 02:14:07 2019 +0300 +++ b/rust/lib-hedgewars-engine/src/render/gear.rs Sat Aug 03 02:51:19 2019 +0300 @@ -48,7 +48,7 @@ let texture = Texture2D::new(max_size, gl::RGBA8, gl::LINEAR); - let mut pixels = Vec::with_capacity(max_size.area()).into_boxed_slice(); + let mut pixels = vec![0; max_size.area() * 4].into_boxed_slice(); for (path, sprite_index) in lookup.drain(..) { if let Some((atlas_index, rect)) = atlas.get_rect(sprite_index) { load_sprite_pixels(&path, &mut pixels[..]).expect("Unable to load Graphics");