82 while (end - p >= 2) {
83 unsigned int item_len = p[0], config_item = p[1];
85 if (item_len < 2 || end - p < item_len || config_item > 4)
88 switch (config_item) {
90 return p - buf + item_len;
168 if (end - p < len + (type == 0x7F) ||
id >= 0x80)
174 to_copy =
FFMIN(len + (p - &buf[1]), 0x800 - qdm->
len[
id]);
175 memcpy(&qdm->
buf[
id][qdm->
len[
id]], buf + 1, to_copy);
176 qdm->
len[
id] += to_copy;
178 return p + len -
buf;
188 int to_copy,
n, res, include_csum;
193 for (n = 0; n < 0x80; n++)
205 if (qdm->
len[n] > 0xff) {
220 memcpy(p, qdm->
buf[n], to_copy);
225 unsigned int total = 0;
230 AV_WB16(csum_pos, (uint16_t) total);
254 "Out of sequence config - dropping queue\n");
256 memset(qdm->
len, 0,
sizeof(qdm->
len));
274 while (end - p >= 4) {
284 for (n = 0; n < 0x80; n++)
292 if (--qdm->
cache == 0)
298 return (qdm->
cache > 0) ? 1 : 0;