mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-03 05:10:03 +02:00
avcodec/huffyuvdec: Test vertical coordinate more often
Fixes: out of array access
Fixes: 22892/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_HYMT_fuzzer-5135996772679680.fuzz
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit a1223ddc56
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
849affacb2
commit
9b432f0e85
@ -982,12 +982,16 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
left= left_prediction(s, p->data[plane], s->temp[0], w, 0);
|
||||
|
||||
y = 1;
|
||||
if (y >= h)
|
||||
break;
|
||||
|
||||
/* second line is left predicted for interlaced case */
|
||||
if (s->interlaced) {
|
||||
decode_plane_bitstream(s, w, plane);
|
||||
left = left_prediction(s, p->data[plane] + p->linesize[plane], s->temp[0], w, left);
|
||||
y++;
|
||||
if (y >= h)
|
||||
break;
|
||||
}
|
||||
|
||||
lefttop = p->data[plane][0];
|
||||
@ -1099,6 +1103,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
}
|
||||
|
||||
cy = y = 1;
|
||||
if (y >= height)
|
||||
break;
|
||||
|
||||
/* second line is left predicted for interlaced case */
|
||||
if (s->interlaced) {
|
||||
@ -1111,6 +1117,8 @@ static int decode_frame(AVCodecContext *avctx, void *data, int *got_frame,
|
||||
}
|
||||
y++;
|
||||
cy++;
|
||||
if (y >= height)
|
||||
break;
|
||||
}
|
||||
|
||||
/* next 4 pixels are left predicted too */
|
||||
|
Loading…
Reference in New Issue
Block a user