This is my attempt to apply Rocq to verify some safety properties of FFmpeg decoders.
FFmpeg is a famous hunting ground for defects. In 2014 Google reported that its fuzzing had already led to more than a thousand fixes. Since then, more than 3,000 commits in FFmpeg's history reference Google's OSS-Fuzz. Claude Mythos Preview found some more, including a 16-year-old bug in the H.264 decoder.
Finding defects is not the same as proving there are none. Anthropic has had Claude automatically generate proofs, checked by Rocq, for other software in OSS-Fuzz: 239 entry points across 123 libraries. FFmpeg was not one of those libraries.
Inspired by the ease of applying AI-assisted theorem proving to binaries, this page tracks my effort to verify the 414 decoders configured for OSS-Fuzz.
I did not start from scratch. My work began with
OSS-Verify, the setup from Theorem
that is behind Anthropic's results. I use its
catalogue of
fuzz targets and the statements to prove about them, its
model
of a RISC-V Linux process (LPS, which I use at commit
c0dd863a),
and its tools for building and checking proofs. The
catalogue already had statements for 420 of FFmpeg's fuzz targets, 414 of them
decoders, with none proved.
For each decoder, the subject is the fuzzer program that OSS-Fuzz runs: it reads an input file and feeds it to the decoder. I want to show two things about that program, each as a theorem checked by Rocq.
Halting is a stronger property than it seems at first glance. The theorem says the program exits normally on any input, so it rules out every abnormal way of stopping as well as running forever. A read or write that runs off a buffer into unmapped memory, or a write to protected memory, would segfault, and that is the kind of bug behind remote code execution. A failed assertion aborts the program. Each of these would make the theorem false, so proving it shows that none of them can happen.
It does not catch everything. An access outside a buffer escapes the theorem only if it faults in no possible arrangement of memory: on every input, it would have to land in memory the program may use.
This goes further than OSS-Verify in two ways. OSS-Verify proves halting for inputs up to 64 MiB; I prove it for inputs up to 256 MiB, which I like because a larger input has more chance of causing an underflow or overflow. And OSS-Verify has no statement about leaks, so the second theorem is an addition.
The theorems are about the compiled program, not the C source, so each one holds for a single binary: one FFmpeg commit, built by one compiler for 64-bit RISC-V, without hand-written assembly, running on one thread with no hardware acceleration. The harness sets limits of its own, and the theorems inherit them. It stops after a fixed number of iterations of its decoding loop (8,096 at present). It refuses any frame of more than 4,096 by 4,096 pixels. And it caps the total number of pixels or samples it will decode, with a tighter budget for some decoders: Targa, for example, gets 1/128 of the default. The harness has these limits to avoid running out of memory and hanging, and without them some of the theorems do not hold. The binary is not position-independent code: it is proved for the one location in memory it is loaded at, not for every address it could be placed at. The proofs also assume that every request for memory succeeds.
The decoders all share one harness, and much of the code under it. So I want to build reusable components that make each later decoder easier to prove.
A proof of one binary also goes stale as soon as FFmpeg changes. I want to be able to reapply each proof to the tip of FFmpeg's master branch easily, without proving again what did not change. For both reasons the proofs are built from more shared, abstract pieces than a typical one-shot proof of a single binary would have.
As of 3 December 2026. Each square is one of the 414 decoders. The table lists only the decoders that are finished or blocked. The name of each proved decoder links to its source, at the FFmpeg commit the proof is about.
Blocked: 13 Proved natively: 3 Kernel proof: 4 Not yet proved: 394
| Decoder | What it decodes | Blocked | Proved natively | Kernel proof | OSS-Verify | Published result |
|---|---|---|---|---|---|---|
| ANULL | Null audio | - | Yes | Yes | - | - |
| VNULL | Null video | - | Yes | Yes | - | proofs/ffmpeg-vnull |
| Targa | Truevision Targa image | - | Yes | Yes | - | - |
| CLJR | Cirrus Logic AccuPak | - | Yes | Yes | - | - |
| ZERO12V | Uncompressed 4:2:2 10-bit | - | Yes | Halting only | #53 | proofs/ffmpeg-zero12v-main |
| V210X | Uncompressed 4:2:2 10-bit | - | Yes | - | - | - |
| AURA2 | Auravision Aura 2 | - | Yes | - | - | - |
| ADPCM_VIMA | LucasArts VIMA audio | FFmpeg #25808 | - | - | #18 | - |
| BMV_AUDIO | Discworld II BMV audio | FFmpeg #25808 | - | - | #18 | - |
| IMC | Intel Music Coder | FFmpeg #25808 | - | - | #18 | - |
| RA_144 | RealAudio 1.0 (14.4K) | FFmpeg #25808 | - | - | #18 | - |
| RA_288 | RealAudio 2.0 (28.8K) | FFmpeg #25808 | - | - | #18 | - |
| SBC | Low-complexity subband codec | FFmpeg #25808 | - | - | #18 | - |
| SIPR | RealAudio SIPR / ACELP.NET | FFmpeg #25808 | - | - | #18 | - |
| SIREN | Siren | FFmpeg #25808 | - | - | #18 | - |
| RKA | RK Audio | FFmpeg #25808 | - | - | - | - |
| WS_SND1 | Westwood Audio (SND1) | FFmpeg #25808 | - | - | - | - |
| ALAC | Apple Lossless Audio Codec | FFmpeg #25954 | - | - | #32 | - |
| ALS | MPEG-4 Audio Lossless Coding | FFmpeg #25954 | - | - | #32 | - |
| WAVARC | Waveform Archiver | FFmpeg #25954 | - | - | #32 | - |
My work has produced three pull requests to FFmpeg so far. None of them fixes a vulnerability. No memory is corrupted and nothing is read or written out of bounds. They fix decoders that fail in a way they should not.
All three are the same kind of fault: given a bad input, an audio decoder outputs a frame with a sample rate of zero. FFmpeg catches this and reports it as an internal bug, when the decoder should have rejected the input as invalid. The decoder fuzzer aborts on any internal bug, so these show up as failures in fuzzing.