| 434 | } |
| 435 | |
| 436 | static int read_patterns(AVCodecContext *avctx, GetBitContext *gb, Bundle *b) |
| 437 | { |
| 438 | int t, v; |
| 439 | const uint8_t *dec_end; |
| 440 | |
| 441 | CHECK_READ_VAL(gb, b, t); |
| 442 | dec_end = b->cur_dec + t; |
| 443 | if (dec_end > b->data_end) { |
| 444 | av_log(avctx, AV_LOG_ERROR, "Too many pattern values\n"); |
| 445 | return AVERROR_INVALIDDATA; |
| 446 | } |
| 447 | while (b->cur_dec < dec_end) { |
| 448 | if (get_bits_left(gb) < 2) |
| 449 | return AVERROR_INVALIDDATA; |
| 450 | v = GET_HUFF(gb, b->tree); |
| 451 | v |= GET_HUFF(gb, b->tree) << 4; |
| 452 | *b->cur_dec++ = v; |
| 453 | } |
| 454 | |
| 455 | return 0; |
| 456 | } |
| 457 | |
| 458 | static int read_colors(GetBitContext *gb, Bundle *b, BinkContext *c) |
| 459 | { |
no test coverage detected