---
id: "CVE-2026-125270"
page: "https://infrastack.ai/live/CVE-2026-125270"
kind: "vulnerability"
aliases: ["CVE-2026-125270"]
title: "FFmpeg: crafted AVI or PNM file leaks heap memory during V4L2 transcoding"
severity: "medium"
cvss: 5.8
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["ffmpeg", "linux", "media-processing", "runtime", "v4l2"]
not_affected_if: ["software-encoders-only", "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-125270", "first_seen_at": "2026-11-09T20:48:14+00:00"}]
exploit_sources: []
---

# FFmpeg: crafted AVI or PNM file leaks heap memory during V4L2 transcoding

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

FFmpeg through 9.0.2 reads past a heap buffer in v4l2_buffer_swframe_to_buf() when a frame has a negative linesize. An attacker who supplies a bottom-up AVI or PNM/PFM file can crash the application or leak heap memory into the encoded output.

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

## How to check

- Check the installed version with `ffmpeg -version` and compare it to the ranges in the NVD record.
- Look for V4L2 M2M encoders in use, such as `h264_v4l2m2m` or `hevc_v4l2m2m`, in scripts or services that transcode untrusted files.

## Timeline

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

## Documents

- [advisory] Third-party advisory: www.vulncheck.com https://www.vulncheck.com/advisories/ffmpeg-through-9.0.2-heap-out-of-bounds-read-in-v4l2-m2m-encoder
- [fix] Patch: github.com https://github.com/FFmpeg/FFmpeg/commit/b8f159858e2fd29dae4fa34d9e713bbf9bbf190e

## From the sources

FFmpeg through 9.0.2 contains a heap out-of-bounds read vulnerability in v4l2_buffer_swframe_to_buf() in libavcodec/v4l2_buffers.c that mishandles frames with negative linesize. Attackers can supply bottom-up AVI or PNM/PFM files that are transcoded to a V4L2 M2M encoder, crashing the application or leaking heap memory into encoded output.

---

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