From: Kostya Shishkov Date: Wed, 15 Apr 2020 13:33:50 +0000 (+0200) Subject: vmd: fix RLE decoding X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=771e522a17b7724a698191ba6f6fe59054161125;p=nihav.git vmd: fix RLE decoding --- diff --git a/nihav-game/src/codecs/vmd.rs b/nihav-game/src/codecs/vmd.rs index b81b4f5..520b57c 100644 --- a/nihav-game/src/codecs/vmd.rs +++ b/nihav-game/src/codecs/vmd.rs @@ -85,9 +85,11 @@ fn rle_unpack(br: &mut ByteReader, len: usize, dst: &mut [u8]) -> DecoderResult< let dst = &mut dst[dpos..][..len]; br.read_buf(dst)?; } else { - let val = br.read_byte()?; - for i in 0..len { - dst[dpos + i] = val; + let val1 = br.read_byte()?; + let val2 = br.read_byte()?; + for i in (0..len).step_by(2) { + dst[dpos + i] = val1; + dst[dpos + i + 1] = val2; } } dpos += len;