MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / read_patterns

Function read_patterns

libavcodec/bink.c:436–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

434}
435
436static 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
458static int read_colors(GetBitContext *gb, Bundle *b, BinkContext *c)
459{

Callers 1

bink_decode_planeFunction · 0.85

Calls 2

av_logFunction · 0.85
get_bits_leftFunction · 0.85

Tested by

no test coverage detected