X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=src%2Fformats.rs;fp=src%2Fformats.rs;h=180e9800433bfc297bd2e2015c3e6d223f17a52a;hb=6c8e5c40938d4e34f062b53e9ad0d4bd6b147b26;hp=aa053b2e75f55df7eb5cf6b7e0b64b3121a89a35;hpb=b5bd2ae4704ee222d4173b63ff8469ba733d4d9f;p=nihav.git diff --git a/src/formats.rs b/src/formats.rs index aa053b2..180e980 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -330,7 +330,11 @@ impl NAPixelChromaton { } pub fn get_linesize(&self, width: usize) -> usize { let d = self.depth as usize; - (self.get_width(width) * d + d - 1) >> 3 + if self.packed { + (self.get_width(width) * d + d - 1) >> 3 + } else { + self.get_width(width) + } } pub fn get_data_size(&self, width: usize, height: usize) -> usize { let nh = (height + ((1 << self.v_ss) - 1)) >> self.v_ss;