From af37e28afd991bca600b97a1cb97bc3ad358bc4f Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Sat, 16 Feb 2019 09:36:43 +0100 Subject: [PATCH] smacker: reset only non-empty last symbols --- nihav-rad/src/codecs/smacker.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nihav-rad/src/codecs/smacker.rs b/nihav-rad/src/codecs/smacker.rs index 85d0e4f..c77b14f 100644 --- a/nihav-rad/src/codecs/smacker.rs +++ b/nihav-rad/src/codecs/smacker.rs @@ -160,7 +160,9 @@ impl SmackerTree16 { } fn reset(&mut self) { for i in 0..self.last.len() { - self.tree[self.last[i]] = 0; + if self.last[i] != SMK_LAST_UNINIT { + self.tree[self.last[i]] = 0; + } } } } -- 2.30.2