From: Kostya Shishkov Date: Fri, 28 Aug 2026 14:48:56 +0000 (+0200) Subject: nihav_codec_support/msstructs: do not error out on greyscale format X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=4011837c4f67c3072b285565d5f7936d2768bf34;p=nihav.git nihav_codec_support/msstructs: do not error out on greyscale format --- diff --git a/nihav-codec-support/src/codecs/msstructs.rs b/nihav-codec-support/src/codecs/msstructs.rs index d5bec5a..e714083 100644 --- a/nihav-codec-support/src/codecs/msstructs.rs +++ b/nihav-codec-support/src/codecs/msstructs.rs @@ -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 {