aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-10-30 23:21:40 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2017-11-01 22:11:10 +0100
commite8fafef1db43ead4eae5a6301ccc300e73aa47da (patch)
treea1461f8a4ce1d12f7467ba7f9edf070376dc201e
parent26868f80e0255483df7de97b3b225a836ef33e60 (diff)
downloadffmpeg-e8fafef1db43ead4eae5a6301ccc300e73aa47da.tar.gz
avcodec/xan: Improve overlapping check
Fixes: memcpy-param-overlap Fixes: 3612/clusterfuzz-testcase-minimized-6393461273001984 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/xan.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 4c01c0013f..8b4ec82405 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -263,7 +263,7 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame,
prevframe_index = (y + motion_y) * stride + x + motion_x;
prevframe_x = x + motion_x;
- if (prev_palette_plane == palette_plane && FFABS(curframe_index - prevframe_index) < pixel_count) {
+ if (prev_palette_plane == palette_plane && FFABS(motion_x + width*motion_y) < pixel_count) {
avpriv_request_sample(s->avctx, "Overlapping copy");
return ;
}