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

Git pushed a commit to branch master
in repository ffmpeg.

commit 4e36265deadfb6e5ae951578bc69a7ac11aded16
Author:     Niklas Haas <[email protected]>
AuthorDate: Fri Feb 20 16:59:07 2026 +0100
Commit:     Niklas Haas <[email protected]>
CommitDate: Thu Feb 26 18:08:49 2026 +0000

    swscale/format: don't mark single byte formats as byte swapped
    
    Fixes a bug where all format lists contained redundant byte swapped
    annotations on big-endian platforms, even for single-byte formats.
---
 libswscale/format.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/libswscale/format.c b/libswscale/format.c
index eb56994beb..017df9f69a 100644
--- a/libswscale/format.c
+++ b/libswscale/format.c
@@ -936,7 +936,8 @@ int ff_sws_decode_pixfmt(SwsOpList *ops, enum AVPixelFormat 
fmt)
 
     /* Set baseline pixel content flags */
     const int integer = ff_sws_pixel_type_is_int(raw_type);
-    const int swapped = (desc->flags & AV_PIX_FMT_FLAG_BE) != 
NATIVE_ENDIAN_FLAG;
+    const int swapped = ff_sws_pixel_type_size(raw_type) > 1 &&
+                        (desc->flags & AV_PIX_FMT_FLAG_BE) != 
NATIVE_ENDIAN_FLAG;
     for (int i = 0; i < rw_op.elems; i++) {
         comps->flags[i] = (integer ? SWS_COMP_EXACT   : 0) |
                           (swapped ? SWS_COMP_SWAPPED : 0);
@@ -1057,7 +1058,8 @@ int ff_sws_encode_pixfmt(SwsOpList *ops, enum 
AVPixelFormat fmt)
         }));
     }
 
-    if ((desc->flags & AV_PIX_FMT_FLAG_BE) != NATIVE_ENDIAN_FLAG) {
+    if (ff_sws_pixel_type_size(raw_type) > 1 &&
+        (desc->flags & AV_PIX_FMT_FLAG_BE) != NATIVE_ENDIAN_FLAG) {
         RET(ff_sws_op_list_append(ops, &(SwsOp) {
             .op   = SWS_OP_SWAP_BYTES,
             .type = raw_type,

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

Reply via email to