X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-codec-support%2Fsrc%2Fdata%2Fmod.rs;h=2ad6b8c9e1fb1fad2e2c1848347acb217ddccd72;hp=b8980f2d9b5180d5c06916650cff93200f7e789e;hb=ed2bdcd95043c7fb9860c67a4e32466acbb61124;hpb=fdd68493ebf7c0e1f367ccd3ec3e6c6848d21eff diff --git a/nihav-codec-support/src/data/mod.rs b/nihav-codec-support/src/data/mod.rs index b8980f2..2ad6b8c 100644 --- a/nihav-codec-support/src/data/mod.rs +++ b/nihav-codec-support/src/data/mod.rs @@ -44,14 +44,14 @@ impl GenericCache { stride, height, xpos: 0, - data: Vec::with_capacity((height + 1) * stride), + data: Vec::with_capacity((height + 1) * stride + 1), default, }; ret.reset(); ret } /// Reports the total amount of elements stored. - pub fn full_size(&self) -> usize { self.stride * (self.height + 1) } + pub fn full_size(&self) -> usize { self.stride * (self.height + 1) + 1 } /// Resets the cache state. pub fn reset(&mut self) { self.data.truncate(0);