---
id: "CVE-2026-125222"
page: "https://infrastack.ai/live/CVE-2026-125222"
kind: "vulnerability"
aliases: ["CVE-2026-125222"]
title: "FFmpeg: crafted Hap video frame overflows heap on 32-bit builds"
severity: "high"
cvss: 7.3
epss: null
exploited: false
status: "open"
category: "runtime"
products: [{"name": "ffmpeg", "fixed": [], "affected": "<= 9.0.2 (32-bit builds)", "ecosystem": "vendor"}]
ecosystems: []
tags: ["32-bit", "ffmpeg", "media-processing", "runtime"]
not_affected_if: ["64-bit-build", "no-hap-decoding"]
published_at: "2026-11-09T19:16:59+00:00"
first_seen_at: "2026-11-09T19:28:19+00:00"
updated_at: "2026-11-09T19:32:38+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125222", "first_seen_at": "2026-11-09T19:28:19+00:00"}, {"source": "analyst", "url": null, "first_seen_at": "2026-11-09T19:32:38+00:00"}]
exploit_sources: []
---

# FFmpeg: crafted Hap video frame overflows heap on 32-bit builds

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

FFmpeg's Hap video decoder miscalculates buffer sizes from crafted Snappy length prefixes, so a malicious Hap file can overflow a heap buffer. An attacker gets a crash or possibly code execution when FFmpeg decodes the file.

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

## Affected

- vendor:ffmpeg affected <= 9.0.2 (32-bit builds) fixed no fixed version listed

## How to check

- Run `ffmpeg -version`: releases through 9.0.2 are listed as affected.
- Check for a 32-bit build: `file $(which ffmpeg)` or `ffmpeg -version` configuration line (i386/armhf/x86 targets). The sources describe the overflow on 32-bit builds.
- Check whether `ffmpeg -decoders` lists `hap` and whether untrusted video reaches it.
- Also check any linked libavcodec (e.g. in other apps) for the same version and architecture.
- To confirm a patch, look for the commit 62c308e in your source tree's libavcodec/hapdec.c.

## Fix

No fixed release named yet (affected: through 9.0.2). The fix is upstream commit 62c308e0416bb701447817fe6f0bff074d206215, which rejects Hap frames whose summed chunk sizes would overflow INT_MAX. Build from master or backport that commit, or move to the first release that contains it once published.

## Timeline

- 2026-11-09T19:28:19+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125222
- 2026-11-09T19:32:38+00:00 analyst — Read FFmpeg commit 62c308e (Niedermayer, 31 Oct 2026, 'avcodec/hap: bound the sum of the uncompressed chunk sizes'; found by ASAN in a 32-bit build, credit Joshua Rogers/AISLE) and the VulnCheck advisory. No fixed release is named in either source; the fix is the commit on master. Neither says 64-bit is safe; 64-bit skip is inferred from the commit's INT_MAX check and the 32-bit wording. No exploitation or PoC reported.

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-heap-buffer-overflow-via-hap-parse-frame-header
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/62c308e0416bb701447817fe6f0bff074d206215

## From the sources

FFmpeg through 9.0.2 contains an integer overflow vulnerability in hap_parse_frame_header() in libavcodec/hapdec.c that allows attackers to trigger a heap buffer overflow on 32-bit builds. Attackers can craft Hap video frames with Snappy length prefixes that wrap tex_size, causing decompress_chunks_thread() to write outside tex_buf and crash the application or potentially execute code.

---

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