]> git.nihav.org Git - nihav.git/commitdiff
vmd: fix typo
authorKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 16 Apr 2020 10:49:57 +0000 (12:49 +0200)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Thu, 16 Apr 2020 10:49:57 +0000 (12:49 +0200)
nihav-game/src/codecs/vmd.rs

index 4e5127a9cf5885680605785634e449738fe50f68..904fe1fc998a0a027c617a6b8a4fdaf3ae7bab1f 100644 (file)
@@ -185,17 +185,17 @@ impl VMDVideoDecoder {
     fn decode_frame(&mut self, br: &mut ByteReader) -> DecoderResult<bool> {
         let frame_x                             = br.read_u16le()? as usize;
         let frame_y                             = br.read_u16le()? as usize;
-        let frame_l                             = br.read_u16le()? as usize;
+        let frame_r                             = br.read_u16le()? as usize;
         let frame_d                             = br.read_u16le()? as usize;
                                                   br.read_skip(1)?;
         let flags                               = br.read_byte()?;
         let has_pal = (flags & 0x02) != 0 && !self.is_16bit && !self.is_24bit;
-        if (frame_x == 0xFFFF) && (frame_y == 0xFFFF) && (frame_l == 0xFFFF) && (frame_d == 0xFFFF) {
+        if (frame_x == 0xFFFF) && (frame_y == 0xFFFF) && (frame_r == 0xFFFF) && (frame_d == 0xFFFF) {
             return Ok(false);
         }
         validate!(frame_x >= self.xoff && frame_y >= self.yoff);
-        validate!(frame_l >= frame_x && frame_d >= frame_y);
-        validate!(frame_l - self.xoff < self.width && frame_d - self.yoff < self.height);
+        validate!(frame_r >= frame_x && frame_d >= frame_y);
+        validate!(frame_r - self.xoff < self.width && frame_d - self.yoff < self.height);
 
         if has_pal {
                                                   br.read_skip(2)?;
@@ -214,7 +214,7 @@ impl VMDVideoDecoder {
             } else {
                 3
             };
-        let w = (frame_l + 1 - frame_x) * bpp;
+        let w = (frame_r + 1 - frame_x) * bpp;
         let h = frame_d + 1 - frame_y;
         let stride = self.width;
         let dpos = (frame_x - self.xoff) * bpp + (frame_y - self.yoff) * stride;