Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-06-05 23:05:27 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 14:33:45 +0300
commitf3dca389bc978582fbe21f9793be5ce5dc3f7709 (patch)
tree83f1df1cd18a52e8f94508ed97c259f28f752f85 /libavcodec
parent14fe71f5dcce45c02cdc65b7dcf3ce6660f8776d (diff)
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 a1223ddc5692772198a02600ecff2545f32b37be) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/huffyuvdec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/huffyuvdec.c b/libavcodec/huffyuvdec.c
index 17c9679cb4..f6a51c3320 100644
--- a/libavcodec/huffyuvdec.c
+++ b/libavcodec/huffyuvdec.c
@@ -988,12 +988,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];
@@ -1105,6 +1109,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) {
@@ -1117,6 +1123,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 */