vmd: raise unpacked buffer size to a factor four
authorKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 15 Apr 2020 09:51:21 +0000 (11:51 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Wed, 15 Apr 2020 09:51:31 +0000 (11:51 +0200)
nihav-game/src/codecs/vmd.rs

index 41bfad987b171528104f4dcce8d7851e8149b299..b81b4f5f1cf19d4ae41744d0da50702968a56448 100644 (file)
@@ -236,7 +236,7 @@ impl NADecoder for VMDVideoDecoder {
             if let Some(ref edata) = info.get_extradata() {
                 validate!(edata.len() == 0x330);
                 let unp_size = read_u32le(&edata[800..])? as usize;
-                validate!(unp_size < self.width * self.height * 3 + 64); // just for sanity
+                validate!(unp_size < self.width * self.height * 4 + 64); // just for sanity
                 self.buf.resize(unp_size, 0);
                 for i in 0..768 {
                     let el = edata[28 + i];