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

Git pushed a commit to branch master
in repository ffmpeg.

commit 0a6145a344c11156f09b67b92654fcafd0b9e42c
Author:     Michael Niedermayer <[email protected]>
AuthorDate: Wed Aug 12 05:33:15 2026 +0200
Commit:     Timo Rothenpieler <[email protected]>
CommitDate: Wed Aug 12 20:05:32 2026 +0200

    avcodec/huffyuv: seed the median predictor endian independently
---
 libavcodec/huffyuv.h    | 2 ++
 libavcodec/huffyuvdec.c | 2 +-
 libavcodec/huffyuvenc.c | 2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavcodec/huffyuv.h b/libavcodec/huffyuv.h
index 62866b7a48..1e792196ad 100644
--- a/libavcodec/huffyuv.h
+++ b/libavcodec/huffyuv.h
@@ -55,6 +55,8 @@ typedef enum Predictor {
     MEDIAN,
 } Predictor;
 
+#define READ_LOWBYTE(plane, bps) ((bps) <= 8 ? (plane)[0] : *(const uint16_t 
*)(plane) & 0xFF)
+
 int ff_huffyuv_generate_bits_table(uint32_t *dst, const uint8_t *len_table, 
int n);
 
 #endif /* AVCODEC_HUFFYUV_H */
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 89430511dd..39959c1c8b 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -985,7 +985,7 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, 
int height,
                         break;
                 }
 
-                lefttop = p->data[plane][0];
+                lefttop = READ_LOWBYTE(p->data[plane], s->bps);
                 decode_plane_bitstream(s, w, plane);
                 add_median_prediction(s, p->data[plane] + fake_stride, 
p->data[plane], s->temp[0], w, &left, &lefttop);
                 y++;
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index dd3ed9a996..9aec2cc462 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -911,7 +911,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket 
*pkt,
                     y++;
                 }
 
-                lefttop = p->data[plane][0];
+                lefttop = READ_LOWBYTE(p->data[plane], s->bps);
 
                 for (; y < h; y++) {
                     const uint8_t *dst = p->data[plane] + p->linesize[plane] * 
y;

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

Reply via email to