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

Git pushed a commit to branch master
in repository ffmpeg.

commit eb47d7bb6cf13042c6ab14e22fc0c0c3a6e51e12
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Tue Oct 13 05:36:47 2026 +0200
Commit:     michaelni <[email protected]>
CommitDate: Tue Oct 20 20:41:50 2026 +0000

    avcodec/flicvideo: byte swap FLI_BRUN pixels of 15/16 bpp FLX as they are 
decoded on big endian
    
    Fixes: 7jy6fSNHGagi
    Fixes: wrong output on big endian
    Wrong output on big endian Replicated through UnModified FFmpeg with 
qemu-s390x output diff
    Found during triage of the security report bQcit4JdHaHN
    Found again by the review of 
https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/24901
---
 libavcodec/flicvideo.c | 19 ++-----------------
 1 file changed, 2 insertions(+), 17 deletions(-)

diff --git a/libavcodec/flicvideo.c b/libavcodec/flicvideo.c
index b8157c0e51..21f861dd3a 100644
--- a/libavcodec/flicvideo.c
+++ b/libavcodec/flicvideo.c
@@ -850,7 +850,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
                         palette_idx1 = bytestream2_get_byte(&g2);
                         CHECK_PIXEL_PTR(byte_run);
                         for (j = 0; j < byte_run; j++) {
-                            pixels[pixel_ptr++] = palette_idx1;
+                            pixels[pixel_ptr++ ^ HAVE_BIGENDIAN] = 
palette_idx1;
                             pixel_countdown--;
                             if (pixel_countdown < 0)
                                 av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 
0 (%d) (linea%d)\n",
@@ -863,7 +863,7 @@ static int flic_decode_frame_15_16BPP(AVCodecContext *avctx,
                         CHECK_PIXEL_PTR(byte_run);
                         for (j = 0; j < byte_run; j++) {
                             palette_idx1 = bytestream2_get_byte(&g2);
-                            pixels[pixel_ptr++] = palette_idx1;
+                            pixels[pixel_ptr++ ^ HAVE_BIGENDIAN] = 
palette_idx1;
                             pixel_countdown--;
                             if (pixel_countdown < 0)
                                 av_log(avctx, AV_LOG_ERROR, "pixel_countdown < 
0 (%d) at line %d\n",
@@ -871,21 +871,6 @@ static int flic_decode_frame_15_16BPP(AVCodecContext 
*avctx,
                         }
                     }
                 }
-
-                /* Now FLX is strange, in that it is "byte" as opposed to 
"pixel" run length compressed.
-                 * This does not give us any good opportunity to perform word 
endian conversion
-                 * during decompression. So if it is required (i.e., this is 
not a LE target, we do
-                 * a second pass over the line here, swapping the bytes.
-                 */
-#if HAVE_BIGENDIAN
-                pixel_ptr = y_ptr;
-                pixel_countdown = s->avctx->width;
-                while (pixel_countdown > 0) {
-                    *((signed short*)(&pixels[pixel_ptr])) = 
AV_RL16(&pixels[pixel_ptr]);
-                    pixel_ptr += 2;
-                    pixel_countdown--;
-                }
-#endif
                 y_ptr += s->frame->linesize[0];
             }
             break;

-- 
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