From 377409f3137810cd917bf450a5d97262a2ad9036 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Tue, 6 Jan 2026 00:49:49 -0600 Subject: [PATCH] Fix oversized DRM dumb buffer for 4:2:0 uploads --- app/streaming/video/ffmpeg-renderers/drm.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/streaming/video/ffmpeg-renderers/drm.cpp b/app/streaming/video/ffmpeg-renderers/drm.cpp index d22e6024..ed1c0763 100644 --- a/app/streaming/video/ffmpeg-renderers/drm.cpp +++ b/app/streaming/video/ffmpeg-renderers/drm.cpp @@ -1093,7 +1093,9 @@ bool DrmRenderer::mapSoftwareFrame(AVFrame *frame, AVDRMFrameDescriptor *mappedF // value of the Y component will also include the space for chroma // since it's all packed into a single plane. if (planes > 1) { - createBuf.height += (2 * AV_CEIL_RSHIFT(frame->height, formatDesc->log2_chroma_h)); + createBuf.height += (2 * AV_CEIL_RSHIFT(frame->height, + formatDesc->log2_chroma_w + + formatDesc->log2_chroma_h)); } int err = drmIoctl(m_DrmFd, DRM_IOCTL_MODE_CREATE_DUMB, &createBuf);