get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/
| 897 | |
| 898 | /*get the distance code tree of a deflated block with fixed tree, as specified in the deflate specification*/ |
| 899 | static unsigned generateFixedDistanceTree(HuffmanTree* tree) |
| 900 | { |
| 901 | unsigned i, error = 0; |
| 902 | unsigned* bitlen = (unsigned*)lodepng_malloc(NUM_DISTANCE_SYMBOLS * sizeof(unsigned)); |
| 903 | if(!bitlen) return 83; /*alloc fail*/ |
| 904 | |
| 905 | /*there are 32 distance codes, but 30-31 are unused*/ |
| 906 | for(i = 0; i < NUM_DISTANCE_SYMBOLS; i++) bitlen[i] = 5; |
| 907 | error = HuffmanTree_makeFromLengths(tree, bitlen, NUM_DISTANCE_SYMBOLS, 15); |
| 908 | |
| 909 | lodepng_free(bitlen); |
| 910 | return error; |
| 911 | } |
| 912 | |
| 913 | #ifdef LODEPNG_COMPILE_DECODER |
| 914 |
no test coverage detected