|
|
@@ -56,13 +56,14 @@ static int build_huff(const uint8_t *src, VLC *vlc, int *fsym) |
|
|
*fsym = he[0].sym; |
|
|
*fsym = he[0].sym; |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
if (he[0].len > 32) |
|
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
|
|
|
last = 255; |
|
|
last = 255; |
|
|
while (he[last].len == 255 && last) |
|
|
while (he[last].len == 255 && last) |
|
|
last--; |
|
|
last--; |
|
|
|
|
|
|
|
|
|
|
|
if (he[last].len > 32) |
|
|
|
|
|
return -1; |
|
|
|
|
|
|
|
|
code = 1; |
|
|
code = 1; |
|
|
for (i = last; i >= 0; i--) { |
|
|
for (i = last; i >= 0; i--) { |
|
|
codes[i] = code >> (32 - he[i].len); |
|
|
codes[i] = code >> (32 - he[i].len); |
|
|
|