Commit 9e2f8ad5ce for ffmpeg
commit 9e2f8ad5ceed784be0d99c54c74f4ff7adc306e7
Author: Michael Niedermayer <michael@niedermayer.cc>
Date: Sat Oct 24 06:38:34 2026 +0200
avcodec/huffyuvenc: do not left-predict a second row that a plane does not have
Out of array read Replicated through API with ASAN
Fixes: out of array read
Fixes: TfmbebVtuO9d
Fixes: AISLE-2026-0150-00921
Found-by: Joshua Rogers (AISLE)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
diff --git a/libavcodec/huffyuvenc.c b/libavcodec/huffyuvenc.c
index c9fd80b838..0719557667 100644
--- a/libavcodec/huffyuvenc.c
+++ b/libavcodec/huffyuvenc.c
@@ -911,7 +911,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
if (s->predictor==MEDIAN) {
int lefttop;
y = 1;
- if (s->interlaced) {
+ if (s->interlaced && h > 1) {
left = sub_left_prediction(s, s->temp[0], p->data[plane] + p->linesize[plane], w , left);
encode_plane_bitstream(s, w, plane);