]> git.nihav.org Git - nihav.git/commitdiff
escape: relax dimensions checking
authorKostya Shishkov <kostya.shiskov@gmail.com>
Sun, 28 Sep 2025 03:59:23 +0000 (05:59 +0200)
committerKostya Shishkov <kostya.shiskov@gmail.com>
Sun, 28 Sep 2025 04:03:57 +0000 (06:03 +0200)
nihav-acorn/src/codecs/escape.rs

index d5b4e07f8529710feeb4d49b53e65b27de4af1ca..efe8ca583fb0fa98a2abaed9da544d9e59d2442f 100644 (file)
@@ -577,7 +577,7 @@ impl NADecoder for Escape130Decoder {
     fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
             let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, YUV420_FORMAT));
-            validate!((vinfo.get_width() | vinfo.get_height()) & 7 == 0);
+            validate!((vinfo.get_width() | vinfo.get_height()) & 1 == 0);
             self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref();
             self.width  = vinfo.get_width();
             self.blocks = vec![E130Block::default(); vinfo.get_width() * vinfo.get_height() / 4];
@@ -740,7 +740,6 @@ impl NADecoder for EscapeAnyDecoder {
     fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
         if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
             let myinfo = NACodecTypeInfo::Video(NAVideoInfo::new(vinfo.get_width(), vinfo.get_height(), false, YUV420_FORMAT));
-            validate!((vinfo.get_width() | vinfo.get_height()) & 7 == 0);
             self.info = NACodecInfo::new_ref(info.get_name(), myinfo, info.get_extradata()).into_ref();
             Ok(())
         } else {