Overview
Comment: | OFDeflateStream: Fix tree construction.
When a bit length had more than 255 occurrences, it caused an integer This also cleans up tree walking. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
aee3bc12f7aded30a6cd005b70ca8dfa |
User & Date: | js on 2013-10-29 22:15:49 |
Other Links: | manifest | tags |
Context
2013-10-29
| ||
22:56 | OFDeflateStream: Fix reading uncompressed header. check-in: d1293b647a user: js tags: trunk | |
22:15 | OFDeflateStream: Fix tree construction. check-in: aee3bc12f7 user: js tags: trunk | |
18:00 | OFZIPArchive: Only check lower byte of minVersion. check-in: 1ce5d53f93 user: js tags: trunk | |
Changes
Modified src/OFDeflateStream.m from [b262daf9b1] to [a8810ba694].
︙ | |||
53 54 55 56 57 58 59 | 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | - + - + - + - + - + | #define MAX_BITS 15 struct huffman_tree { struct huffman_tree *leafs[2]; uint16_t value; }; |
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 | - + | tree->value = value; } static struct huffman_tree* constructTree(uint8_t lengths[], uint_fast16_t count) { struct huffman_tree *tree; |
︙ | |||
195 196 197 198 199 200 201 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 | - - - - - + - + - - - | static bool walkTree(OFDeflateStream *stream, struct huffman_tree **tree, uint16_t *value) { struct huffman_tree *iter = *tree; uint_fast16_t bits; |
︙ |