aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-commonfmt
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2022-11-25 17:43:19 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2022-11-25 17:43:19 +0100
commit7662c04c2bc4cf69113b0c4212dde88809d0299d (patch)
tree38853a683d8617936e13c3463759ddc0499f85f6 /nihav-commonfmt
parent7f839ae7ac1eef6718bf508648ef9f287cc793bd (diff)
downloadnihav-7662c04c2bc4cf69113b0c4212dde88809d0299d.tar.gz
cinepak: fix handling of intra slices in inter frames
Diffstat (limited to 'nihav-commonfmt')
-rw-r--r--nihav-commonfmt/src/codecs/cinepak.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/nihav-commonfmt/src/codecs/cinepak.rs b/nihav-commonfmt/src/codecs/cinepak.rs
index e558da9..d7a80dc 100644
--- a/nihav-commonfmt/src/codecs/cinepak.rs
+++ b/nihav-commonfmt/src/codecs/cinepak.rs
@@ -111,6 +111,7 @@ impl CinepakDecoder {
let mut idx_pos = 0;
let mut idx_size = 0;
let mut v1_only = false;
+ let mut intra_mode = true;
while br.left() > 0 {
let id = br.read_byte()?;
if (id & 0xF0) == 0x20 && is_intra_strip {
@@ -136,6 +137,7 @@ impl CinepakDecoder {
0x31 => { // inter indices
validate!(!is_intra);
validate!(idx_pos == 0);
+ intra_mode = false;
idx_pos = br.tell() as usize;
idx_size = size - 4;
br.read_skip(idx_size)?;
@@ -161,7 +163,7 @@ impl CinepakDecoder {
let mut flags = if !v1_only { br.read_u32be()? } else { 0x00000000 };
let mut mask = 1 << 31;
while mask > 0 {
- if !is_intra {
+ if !intra_mode {
let skip = (flags & mask) == 0;
mask >>= 1;
if skip {