]> git.nihav.org Git - nihav.git/commitdiff
vmd: ignore empty frames
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 26 Mar 2020 14:11:58 +0000 (15:11 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 26 Mar 2020 14:11:58 +0000 (15:11 +0100)
nihav-game/src/codecs/vmd.rs

index 3e002ea40f6a39f1cda820402380d2dc87f4192b..21be388664d30f3dea21018c16afaaa65de65f94 100644 (file)
@@ -180,6 +180,9 @@ impl VMDVideoDecoder {
                                                   br.read_skip(1)?;
         let flags                               = br.read_byte()?;
         let has_pal = (flags & 0x02) != 0;
+        if (frame_x == 0xFFFF) && (frame_y == 0xFFFF) && (frame_l == 0xFFFF) && (frame_d == 0xFFFF) {
+            return Ok(false);
+        }
         validate!(frame_l >= frame_x && frame_d >= frame_y);
         validate!(frame_l < self.width && frame_d < self.height);