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:
@ -957,12 +957,16 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height,
|
|||||||
left= left_prediction(s, p->data[plane], s->temp[0], w, 0);
|
left= left_prediction(s, p->data[plane], s->temp[0], w, 0);
|
||||||
|
|
||||||
y = 1;
|
y = 1;
|
||||||
|
if (y >= h)
|
||||||
|
break;
|
||||||
|
|
||||||
/* second line is left predicted for interlaced case */
|
/* second line is left predicted for interlaced case */
|
||||||
if (s->interlaced) {
|
if (s->interlaced) {
|
||||||
decode_plane_bitstream(s, w, plane);
|
decode_plane_bitstream(s, w, plane);
|
||||||
left = left_prediction(s, p->data[plane] + p->linesize[plane], s->temp[0], w, left);
|
left = left_prediction(s, p->data[plane] + p->linesize[plane], s->temp[0], w, left);
|
||||||
y++;
|
y++;
|
||||||
|
if (y >= h)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
lefttop = p->data[plane][0];
|
lefttop = p->data[plane][0];
|
||||||
@ -1074,6 +1078,8 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height,
|
|||||||
}
|
}
|
||||||
|
|
||||||
cy = y = 1;
|
cy = y = 1;
|
||||||
|
if (y >= height)
|
||||||
|
break;
|
||||||
|
|
||||||
/* second line is left predicted for interlaced case */
|
/* second line is left predicted for interlaced case */
|
||||||
if (s->interlaced) {
|
if (s->interlaced) {
|
||||||
@ -1086,6 +1092,8 @@ static int decode_slice(AVCodecContext *avctx, AVFrame *p, int height,
|
|||||||
}
|
}
|
||||||
y++;
|
y++;
|
||||||
cy++;
|
cy++;
|
||||||
|
if (y >= height)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* next 4 pixels are left predicted too */
|
/* next 4 pixels are left predicted too */
|
||||||
|
Reference in New Issue
Block a user