81 while (end - p >= 2) {
82 unsigned int item_len = p[0], config_item = p[1];
84 if (item_len < 2 || end - p < item_len || config_item > 4)
87 switch (config_item) {
89 return p - buf + item_len;
157 unsigned int id,
len, type, to_copy;
169 if (end - p < len + (type == 0x7F) ||
id >= 0x80)
175 to_copy =
FFMIN(len + (p - &buf[1]), 0x800 - qdm->
len[
id]);
176 memcpy(&qdm->
buf[
id][qdm->
len[
id]], buf + 1, to_copy);
177 qdm->
len[
id] += to_copy;
179 return p + len - buf;
189 int to_copy, n, res, include_csum;
193 assert(qdm->
cache > 0);
194 for (n = 0; n < 0x80; n++)
206 if (qdm->
len[n] > 0xff) {
221 memcpy(p, qdm->
buf[n], to_copy);
226 unsigned int total = 0;
231 AV_WB16(csum_pos, (uint16_t) total);
255 "Out of sequence config - dropping queue\n");
257 memset(qdm->
len, 0,
sizeof(qdm->
len));
275 while (end - p >= 4) {
285 for (n = 0; n < 0x80; n++)
293 if (--qdm->
cache == 0)
299 return (qdm->
cache > 0) ? 1 : 0;