Forráskód Böngészése

[std] deal with huffman nlengths = 1 case

closes #8875
Simon Krajewski 5 éve
szülő
commit
15cc403e2f
2 módosított fájl, 4 hozzáadás és 0 törlés
  1. 1 0
      extra/CHANGES.txt
  2. 3 0
      std/haxe/zip/Huffman.hx

+ 1 - 0
extra/CHANGES.txt

@@ -13,6 +13,7 @@
 	cs : fixed Json.stringify for @:struct-annotated classes (#8979)
 	cs : fixed bitwise shifts for `cs.types.Int64` (#8978)
 	python : fixed invalid generation of some inlined code blocks (#8971)
+	std : fixed an exception from `haxe.zip.Huffman` on reading a zip (#8875)
 	windows : workaround windows installer being detected as a malware by some anti-virus software (#8951)
 	windows : fix PATH env var modification when running windows installer without admin privileges (#8870)
 

+ 3 - 0
std/haxe/zip/Huffman.hx

@@ -84,6 +84,9 @@ class HuffTools {
 	}
 
 	public function make(lengths, pos, nlengths, maxbits) {
+		if (nlengths == 1) {
+			return NeedBit(Found(0), Found(0));
+		}
 		var counts = new Array();
 		var tmp = new Array();
 		if (maxbits > 32)