This is an automated email from the git hooks/post-receive script.

Git pushed a commit to branch master
in repository ffmpeg.

commit 16e0ddc40d7d8c59967ff712861d97d5e7978cf8
Author:     Lynne <[email protected]>
AuthorDate: Thu Oct 8 13:27:18 2026 +0900
Commit:     Lynne <[email protected]>
CommitDate: Thu Oct 8 14:21:36 2026 +0900

    lavu/frame: allow left cropping of formats with multi-byte pixels
    
    av_frame_apply_cropping() returned AVERROR_BUG when the plane offset was
    more aligned than crop_left, which is always the case for single-plane
    formats with more than a byte per pixel (gray16, rgb48, 16-bit Bayer,
    p010). The rounding that follows already handles it.
---
 libavutil/frame.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/libavutil/frame.c b/libavutil/frame.c
index be30eb09d2..ca8e8486a3 100644
--- a/libavutil/frame.c
+++ b/libavutil/frame.c
@@ -803,11 +803,8 @@ int av_frame_apply_cropping(AVFrame *frame, int flags)
             min_log2_align = FFMIN(log2_align, min_log2_align);
         }
 
-        /* we assume, and it should always be true, that the data alignment is
-         * related to the cropping alignment by a constant power-of-2 factor */
-        if (log2_crop_align < min_log2_align)
-            return AVERROR_BUG;
-
+        /* The data alignment is the cropping alignment scaled by a power of 2,
+         * up for multi-byte pixels and down for subsampled planes */
         if (min_log2_align < 5 && log2_crop_align != INT_MAX) {
             frame->crop_left &= ~((1 << (5 + log2_crop_align - 
min_log2_align)) - 1);
             ret = calc_cropping_offsets(offsets, frame, desc);

-- 
To stop receiving notification emails like this one, please contact
[email protected].
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to