X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-codec-support%2Fsrc%2Fdata%2Fmod.rs;h=2ad6b8c9e1fb1fad2e2c1848347acb217ddccd72;hb=a715e99fd5a8b724cf31877c74bbd8191d7fd256;hp=b8980f2d9b5180d5c06916650cff93200f7e789e;hpb=e65c00402a7bfdeb7e1922a46fab0fbabb7bbf33;p=nihav.git 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);