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>2022-06-09 23:36:00 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2022-07-12 23:09:38 +0300
commit93d44b10e8bdcf94d2945e0a19572a759e433de9 (patch)
tree77b7eb16ddf95b51f394b89cd018fb083768432f
parent06bd0a44a8a0289afe2ab7a66a62bdde4517207d (diff)
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: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit b7e30a13d4e4557b87f977b76a6bb5e3cbe5ac78) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/cdgraphics.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cdgraphics.c b/libavcodec/cdgraphics.c
index da6fb7af03..3d8219a451 100644
--- a/libavcodec/cdgraphics.c
+++ b/libavcodec/cdgraphics.c
@@ -238,7 +238,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++)
memcpy(out + FFMAX(0, hinc) + stride * y,
in + FFMAX(0, hinc) - hinc + (y - vinc) * stride,
- FFMIN(stride + hinc, stride));
+ FFABS(stride) - FFABS(hinc));
if (vinc > 0)
cdg_fill_wrapper(0, 0, out,