| 57 | } |
| 58 | |
| 59 | static int decode_run_8bit(GetBitContext *gb, int *color) |
| 60 | { |
| 61 | int len; |
| 62 | int has_run = get_bits1(gb); |
| 63 | if (get_bits1(gb)) |
| 64 | *color = get_bits(gb, 8); |
| 65 | else |
| 66 | *color = get_bits(gb, 2); |
| 67 | if (has_run) { |
| 68 | if (get_bits1(gb)) { |
| 69 | len = get_bits(gb, 7); |
| 70 | if (len == 0) |
| 71 | len = INT_MAX; |
| 72 | else |
| 73 | len += 9; |
| 74 | } else |
| 75 | len = get_bits(gb, 3) + 2; |
| 76 | } else |
| 77 | len = 1; |
| 78 | return len; |
| 79 | } |
| 80 | |
| 81 | static int decode_rle(uint8_t *bitmap, int linesize, int w, int h, |
| 82 | const uint8_t *buf, int start, int buf_size, int is_8bit) |
no test coverage detected