PR #26298 opened by Ramiro Polla (ramiro)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26298
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/26298.patch

In 46cb7b8d9d, the data pointers in av_frame_get_buffer() were aligned
for planes 1 through 3, but plane 0 was still left at the alignment of
the allocator.

Signed-off-by: Ramiro Polla <[email protected]>



>From 34af1493728d8bcddc35a0f9d858e15663375a87 Mon Sep 17 00:00:00 2001
From: Ramiro Polla <[email protected]>
Date: Mon, 23 Nov 2026 00:56:16 +0100
Subject: [PATCH] avutil/frame: also align the first plane in
 av_frame_get_buffer()

In 46cb7b8d9d, the data pointers in av_frame_get_buffer() were aligned
for planes 1 through 3, but plane 0 was still left at the alignment of
the allocator.

Signed-off-by: Ramiro Polla <[email protected]>
---
 libavutil/frame.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index c79c1b76d52..d13b362fa0b 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -132,7 +132,7 @@ int ff_frame_get_video_buffer(AVFrame *frame, int align,
                                       frame->buf[0]->data, frame->linesize)) < 
0)
         goto fail;
 
-    for (int i = 1; i < 4; i++) {
+    for (int i = 0; i < 4; i++) {
         if (frame->data[i])
             frame->data[i] += i * plane_padding;
         frame->data[i] = (uint8_t *)FFALIGN((uintptr_t)frame->data[i], align);
-- 
2.54.1

_______________________________________________
ffmpeg-devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to