| 107 | } |
| 108 | |
| 109 | static int read_map(GetBitContext *gb, Table *t, unsigned int map[DST_MAX_CHANNELS], int channels) |
| 110 | { |
| 111 | int ch; |
| 112 | t->elements = 1; |
| 113 | map[0] = 0; |
| 114 | if (!get_bits1(gb)) { |
| 115 | for (ch = 1; ch < channels; ch++) { |
| 116 | int bits = av_log2(t->elements) + 1; |
| 117 | map[ch] = get_bits(gb, bits); |
| 118 | if (map[ch] == t->elements) { |
| 119 | t->elements++; |
| 120 | if (t->elements >= DST_MAX_ELEMENTS) |
| 121 | return AVERROR_INVALIDDATA; |
| 122 | } else if (map[ch] > t->elements) { |
| 123 | return AVERROR_INVALIDDATA; |
| 124 | } |
| 125 | } |
| 126 | } else { |
| 127 | memset(map, 0, sizeof(*map) * DST_MAX_CHANNELS); |
| 128 | } |
| 129 | return 0; |
| 130 | } |
| 131 | |
| 132 | static av_always_inline int get_sr_golomb_dst(GetBitContext *gb, unsigned int k) |
| 133 | { |
no test coverage detected