]> git.nihav.org Git - nihav.git/commitdiff
nihav_codec_support/msstructs: do not error out on greyscale format
authorKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 28 Aug 2026 14:48:56 +0000 (16:48 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Fri, 28 Aug 2026 14:48:56 +0000 (16:48 +0200)
nihav-codec-support/src/codecs/msstructs.rs

index d5bec5ab4f3d25f230fb6e82877971f182938c9d..e71408368d5fc06e7e690aeff6474536a04f45da 100644 (file)
@@ -56,7 +56,7 @@ impl MSBitmapInfo {
             if !(1..=32).contains(&self.bitcount) {
                 return Err("bitcount");
             }
-            if (self.bitcount <= 8 && (self.colors == 0 || self.colors > (1 << self.bitcount))) || (self.bitcount > 8 && self.colors != 0) {
+            if (self.bitcount <= 8 && !(&self.compression[..2] == b"Y8") && (self.colors == 0 || self.colors > (1 << self.bitcount))) || (self.bitcount > 8 && self.colors != 0) {
                 return Err("clr_used");
             }
             if self.clr_important as usize > self.colors {