aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2020-07-10 18:32:14 +0200
committerKostya Shishkov <kostya.shishkov@gmail.com>2020-07-10 18:32:14 +0200
commit36294f20b37c13c8b4c468a08e803baedac7e938 (patch)
tree5077ae43ba1a8d91a4fdb8effb5e037c5fc77e1e
parent4abaf99e414dd4dd270e2703ee5e799a61aada88 (diff)
downloadnihav-36294f20b37c13c8b4c468a08e803baedac7e938.tar.gz
core/scale: fix flipping of packed 16- and 32-bit images
-rw-r--r--nihav-core/src/scale/mod.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/nihav-core/src/scale/mod.rs b/nihav-core/src/scale/mod.rs
index 2192b18..f93b9d2 100644
--- a/nihav-core/src/scale/mod.rs
+++ b/nihav-core/src/scale/mod.rs
@@ -320,7 +320,7 @@ pub fn flip_picture(pic: &mut NABufferType) -> ScaleResult<()> {
}
},
NABufferType::Video16(ref mut vb) => {
- let ncomp = vb.get_num_components();
+ let ncomp = vb.get_num_components().max(1);
for comp in 0..ncomp {
let off = vb.get_offset(comp);
let stride = vb.get_stride(comp);
@@ -332,7 +332,7 @@ pub fn flip_picture(pic: &mut NABufferType) -> ScaleResult<()> {
}
},
NABufferType::Video32(ref mut vb) => {
- let ncomp = vb.get_num_components();
+ let ncomp = vb.get_num_components().max(1);
for comp in 0..ncomp {
let off = vb.get_offset(comp);
let stride = vb.get_stride(comp);