diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-12-05 10:25:05 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2020-12-05 10:25:05 +0100 |
commit | ed2bdcd95043c7fb9860c67a4e32466acbb61124 (patch) | |
tree | ace2dde7aab55db0c3492031078362c702ba7ab1 | |
parent | fdd68493ebf7c0e1f367ccd3ec3e6c6848d21eff (diff) | |
download | nihav-ed2bdcd95043c7fb9860c67a4e32466acbb61124.tar.gz |
codec_support/data: fix GenericCache internal size
-rw-r--r-- | nihav-codec-support/src/data/mod.rs | 4 |
1 files changed, 2 insertions, 2 deletions
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<T:Copy> GenericCache<T> { 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); |