Index: trunk/Mars/mcore/huffman.h
===================================================================
--- trunk/Mars/mcore/huffman.h	(revision 15625)
+++ trunk/Mars/mcore/huffman.h	(revision 15627)
@@ -178,6 +178,6 @@
         Encoder(const uint16_t *bufin, size_t bufinlen) : count(0)
         {
-            uint16_t counts[MAX_SYMBOLS];
-            memset(counts, 0, sizeof(uint16_t)*MAX_SYMBOLS);
+            uint64_t counts[MAX_SYMBOLS];
+            memset(counts, 0, sizeof(uint64_t)*MAX_SYMBOLS);
 
             // Count occurances
@@ -281,4 +281,11 @@
         {
             Decoder const *p = this;
+
+            if (in_ptr==in_end)
+            {
+                while (out_ptr < out_end)
+                    *out_ptr++ = p->lut->symbol;
+                return in_ptr;
+            }
 
             uint8_t curbit = 0;
