25 int first_header_size,
const uint8_t *header_start[3],
30 if (extradata_size >= 6 &&
AV_RB16(extradata) == first_header_size) {
33 header_len[i] =
AV_RB16(extradata);
35 header_start[i] = extradata;
36 extradata += header_len[i];
37 if (overall_len > extradata_size - header_len[i])
39 overall_len += header_len[i];
41 }
else if (extradata_size >= 3 && extradata_size < INT_MAX - 0x1ff && extradata[0] == 2) {
44 for (i=0; i<2; i++, extradata++) {
46 for (; overall_len < extradata_size && *extradata==0xff; extradata++) {
47 header_len[i] += 0xff;
48 overall_len += 0xff + 1;
50 header_len[i] += *extradata;
51 overall_len += *extradata;
52 if (overall_len > extradata_size)
55 header_len[2] = extradata_size - overall_len;
56 header_start[0] = extradata;
57 header_start[1] = header_start[0] + header_len[0];
58 header_start[2] = header_start[1] + header_len[1];