---
id: "CVE-2026-125265"
page: "https://infrastack.ai/live/CVE-2026-125265"
kind: "vulnerability"
aliases: ["CVE-2026-125265"]
title: "FFmpeg: crafted video triggers use-after-free in NVDEC decoding"
severity: "medium"
cvss: 5.8
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["ffmpeg", "media-processing", "nvdec", "package", "self-hosted"]
not_affected_if: ["no-nvdec", "trusted-input-only"]
published_at: "2026-11-09T20:18:13+00:00"
first_seen_at: "2026-11-09T20:48:14+00:00"
updated_at: "2026-11-09T20:49:52+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-125265", "first_seen_at": "2026-11-09T20:48:14+00:00"}]
exploit_sources: []
---

# FFmpeg: crafted video triggers use-after-free in NVDEC decoding

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

FFmpeg through 9.0.2 fails to reset a bitstream pointer in its NVDEC hardware decoder after slice errors, so a crafted video can make it read freed heap memory. An attacker gets application crashes or leaks stale heap contents.

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

## How to check

- Check the installed FFmpeg version with `ffmpeg -version`
- Check whether the build uses NVDEC hardware decoding (`-hwaccel nvdec` or `cuvid` decoders) in your pipeline

## Fix

- Move to a FFmpeg release newer than `9.0.2`; the sources do not name the exact fixed version

## Timeline

- 2026-11-09T20:48:14+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-125265

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-use-after-free-via-nvdec-stale-bitstream-pointer
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/03cd7851955c023f1ff4c8a495d47e996d01485a

## From the sources

FFmpeg through 9.0.2 contains a use-after-free vulnerability in libavcodec/nvdec.c because ff_nvdec_start_frame() fails to reset ctx->bitstream after slice errors. Attackers can supply crafted video that abandons a picture before end_frame, causing cuvidDecodePicture() to read freed heap memory, crashing applications or exposing stale heap contents.

---

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