---
id: "CVE-2026-125212"
page: "https://infrastack.ai/live/CVE-2026-125212"
kind: "vulnerability"
aliases: ["CVE-2026-125212"]
title: "FFmpeg: crafted mid-stream resolution change overflows heap via VideoToolbox encoder"
severity: "high"
cvss: 7.3
epss: null
exploited: false
status: "open"
category: "package"
products: [{"name": "ffmpeg", "fixed": [], "affected": "<= 9.0.2", "ecosystem": "vendor"}]
ecosystems: []
tags: ["ffmpeg", "macos", "media-processing", "package", "videotoolbox"]
not_affected_if: ["no-videotoolbox-encoder", "trusted-input-only"]
published_at: "2026-11-09T19:16:58+00:00"
first_seen_at: "2026-11-09T19:28:18+00:00"
updated_at: "2026-11-09T19:33:56+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125212", "first_seen_at": "2026-11-09T19:28:18+00:00"}, {"source": "analyst", "url": null, "first_seen_at": "2026-11-09T19:33:56+00:00"}]
exploit_sources: []
---

# FFmpeg: crafted mid-stream resolution change overflows heap via VideoToolbox encoder

Link for people: https://infrastack.ai/live/CVE-2026-125212 (this .md is for agents)

FFmpeg's VideoToolbox encoder copies frames larger than its output buffers when a stream's resolution grows mid-stream, causing a heap buffer overflow. An attacker who supplies a crafted media file can crash the application or corrupt memory.

_Summary, check and fix written by a model from the sources; labelled as such._

## Affected

- vendor:ffmpeg affected <= 9.0.2 fixed no fixed version listed

## How to check

- Run `ffmpeg -version`. Releases up to and including 9.0.2 are listed as affected; the fixed release is not named yet.
- Check whether you encode with `h264_videotoolbox` or `hevc_videotoolbox` on macOS (`ffmpeg -encoders | grep videotoolbox`).
- Check whether your pipeline can pass input whose resolution grows mid-stream without rescaling (e.g. `-noautoscale`, or libavcodec API use without a scaler).
- Also check if you use other FFmpeg encoders (the commit message says software encoders were found during triage) and check your build has commit 9b99973.

## Fix

Upstream commit 9b99973 (avcodec/encode: reject video frames larger than the encoder too) fixes it in libavcodec/encode.c. No release containing it is named in the sources: fixed version unknown. Until then build from master with the commit, or avoid -noautoscale and make sure frames are scaled to the encoder size before a VideoToolbox encoder.

## Timeline

- 2026-11-09T19:28:18+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125212
- 2026-11-09T19:33:56+00:00 analyst — Read vulncheck advisory (affected <= 9.0.2, no fixed release named) and the upstream commit 9b99973 (libavcodec/encode.c: encoder now rejects any frame whose size differs from the encoder's). Commit page names no release tag, so fixed version is unknown. Web-cli was out of credits; used WebFetch.

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-heap-buffer-overflow-via-videotoolbox-encoder
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/9b99973b2bbecee0b7e1e57035b95498b42f54a6

## From the sources

FFmpeg through 9.0.2 contains a heap buffer overflow vulnerability in libavcodec/videotoolboxenc.c that copies frames larger than encoder dimensions into undersized CVPixelBuffers. Attackers can supply crafted input whose resolution grows mid-stream, transcoded with VideoToolbox encoders without rescaling, to crash the application or corrupt memory.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
