| 175 | } |
| 176 | |
| 177 | static int read_len_table(uint8_t *dst, GetBitContext *gb){ |
| 178 | int i, val, repeat; |
| 179 | |
| 180 | for(i=0; i<256;){ |
| 181 | repeat= get_bits(gb, 3); |
| 182 | val = get_bits(gb, 5); |
| 183 | if(repeat==0) |
| 184 | repeat= get_bits(gb, 8); |
| 185 | //printf("%d %d\n", val, repeat); |
| 186 | if(i+repeat > 256) { |
| 187 | av_log(NULL, AV_LOG_ERROR, "Error reading huffman table\n"); |
| 188 | return -1; |
| 189 | } |
| 190 | while (repeat--) |
| 191 | dst[i++] = val; |
| 192 | } |
| 193 | return 0; |
| 194 | } |
| 195 | |
| 196 | static int generate_bits_table(uint32_t *dst, const uint8_t *len_table){ |
| 197 | int len, index; |
no test coverage detected