---
id: "CVE-2026-125257"
page: "https://infrastack.ai/live/CVE-2026-125257"
kind: "vulnerability"
aliases: ["CVE-2026-125257"]
title: "FFmpeg: off-by-one heap overflow when encoding Nellymoser audio with trellis"
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", "libavcodec", "media-processing", "package"]
not_affected_if: ["no-nellymoser-encoding", "trellis-disabled"]
published_at: "2026-11-09T20:18:11+00:00"
first_seen_at: "2026-11-09T20:48:13+00:00"
updated_at: "2026-11-09T20:50:59+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125257", "first_seen_at": "2026-11-09T20:48:13+00:00"}, {"source": "analyst", "url": null, "first_seen_at": "2026-11-09T20:50:59+00:00"}]
exploit_sources: []
---

# FFmpeg: off-by-one heap overflow when encoding Nellymoser audio with trellis

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

FFmpeg's Nellymoser encoder writes one element past its allocated buffers in get_exponent_dynamic() when trellis is enabled. A crafted audio input can overwrite adjacent heap memory, which can lead to code execution or a crash.

_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; 9.0.2 or earlier is affected unless your build includes commit 733bec3e
- Only encoding is affected: check whether anything runs ffmpeg with -c:a nellymoser (trellis search) on untrusted audio; decoding and other codecs do not reach this code

## Fix

Fixed on FFmpeg master by commit 733bec3e19759520ccdbeb6c3c0cae280bbe6dc5 (libavcodec/nellymoserenc.c). No released version stated yet; build from a tree containing the commit or check for a release after 9.0.2.

## Timeline

- 2026-11-09T20:48:13+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125257
- 2026-11-09T20:50:59+00:00 analyst — Read FFmpeg commit 733bec3e (1-line clamp OPT_SIZE -> OPT_SIZE-1 in get_exponent_dynamic, found by Zheng Yu/depthfirst) and VulnCheck advisory (<=9.0.2). No fixed release named in either; no exploitation or PoC stated. Exa out of credits, used WebFetch.

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-heap-overflow-via-nellymoser-encoder-trellis-search
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/733bec3e19759520ccdbeb6c3c0cae280bbe6dc5

## From the sources

FFmpeg through 9.0.2 contains an off-by-one heap overflow vulnerability in get_exponent_dynamic() in libavcodec/nellymoserenc.c that allows writing one element past the opt and path allocations. Attackers can supply crafted audio to applications encoding Nellymoser with trellis enabled, causing idx to equal OPT_SIZE and overwrite adjacent heap memory.

---

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