| 4572 | } |
| 4573 | |
| 4574 | stbi_inline static int stbi__zhuffman_decode(stbi__zbuf* a, stbi__zhuffman* z) { |
| 4575 | int b, s; |
| 4576 | if (a->num_bits < 16) { |
| 4577 | if (stbi__zeof(a)) { |
| 4578 | return -1; /* report error for unexpected end of data. */ |
| 4579 | } |
| 4580 | stbi__fill_bits(a); |
| 4581 | } |
| 4582 | b = z->fast[a->code_buffer & STBI__ZFAST_MASK]; |
| 4583 | if (b) { |
| 4584 | s = b >> 9; |
| 4585 | a->code_buffer >>= s; |
| 4586 | a->num_bits -= s; |
| 4587 | return b & 511; |
| 4588 | } |
| 4589 | return stbi__zhuffman_decode_slowpath(a, z); |
| 4590 | } |
| 4591 | |
| 4592 | static int stbi__zexpand( |
| 4593 | stbi__zbuf* z, char* zout, int n) // need to make room for n bytes |
no test coverage detected