FFmpeg heap corruption in JPEG CBS scan writing on 32-bit builds
FFmpeg
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| FFmpeg FFmpeg |
| No fix yet |
Original description
FFmpeg through 9.0.2 contains an integer overflow in cbs_jpeg_write_scan() in libavcodec/cbs_jpeg.c that causes a heap buffer overflow on 32-bit builds. Attackers can supply a crafted MJPEG/JPEG stream with a scan of 512 MiB or more, processed by CBS bitstream filters like filter_units, to corrupt the heap or crash the application.
From the CVE record · VulnCheck
References
- code.ffmpeg.org/FFmpeg/FFmpeg/pulls/25232
- github.com/FFmpeg/FFmpeg/commit/b89ce54d93bf644433dfa9fbc34f19c22237691aPatch
- github.com/FFmpeg/FFmpeg/blob/n9.0.2/libavcodec/cbs_jpeg.c#L299
- github.com/FFmpeg/FFmpeg
- vulncheck.com/advisories/ffmpeg-through-9.0.2-heap-buffer-overflow-via-cbs-jpeg-write-scan-integer-overflow
- code.ffmpeg.org/FFmpeg/FFmpeg
- github.com/CVEProject/cvelistV5/tree/main/cves/2026/125xxx/CVE-2026-125227.json
- nvd.nist.gov/vuln/detail/CVE-2026-125227