]> git.nihav.org Git - nihav.git/commitdiff
smacker: reset only non-empty last symbols
authorKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 16 Feb 2019 08:36:43 +0000 (09:36 +0100)
committerKostya Shishkov <kostya.shishkov@gmail.com>
Sat, 16 Feb 2019 08:36:43 +0000 (09:36 +0100)
nihav-rad/src/codecs/smacker.rs

index 85d0e4fceed48bc903c0d03938458e39ae06a44d..c77b14ffcf8d83a13466d70c49d6af7d8f5594ff 100644 (file)
@@ -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;
+            }
         }
     }
 }