Skip to content
Snippets Groups Projects
Unverified Commit d5d3f80e authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/cdgraphics: limit scrolling to the line

Fixes: out of array access
Fixes: 47877/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_CDGRAPHICS_fuzzer-5690504626438144

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit b7e30a13)
Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 4d7a4f66
No related branches found
No related tags found
No related merge requests found
...@@ -239,7 +239,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data, ...@@ -239,7 +239,7 @@ static void cdg_scroll(CDGraphicsContext *cc, uint8_t *data,
for (y = FFMAX(0, vinc); y < FFMIN(CDG_FULL_HEIGHT + vinc, CDG_FULL_HEIGHT); y++) for (y = FFMAX(0, vinc); y < FFMIN(CDG_FULL_HEIGHT + vinc, CDG_FULL_HEIGHT); y++)
memcpy(out + FFMAX(0, hinc) + stride * y, memcpy(out + FFMAX(0, hinc) + stride * y,
in + FFMAX(0, hinc) - hinc + (y - vinc) * stride, in + FFMAX(0, hinc) - hinc + (y - vinc) * stride,
FFMIN(stride + hinc, stride)); FFABS(stride) - FFABS(hinc));
if (vinc > 0) if (vinc > 0)
cdg_fill_wrapper(0, 0, out, cdg_fill_wrapper(0, 0, out,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment