diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-10-30 23:21:40 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-11-01 22:18:20 +0100 |
commit | 80b6f5d1dc7e2f741119b0c545793c0df459a9b3 (patch) | |
tree | fe18376dc90a936f9fd8c30cb7452b6152c244e4 | |
parent | c1cd31b182bd187e9bf6f6187d63f79571b6aad9 (diff) | |
download | ffmpeg-80b6f5d1dc7e2f741119b0c545793c0df459a9b3.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>
(cherry picked from commit e8fafef1db43ead4eae5a6301ccc300e73aa47da)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/xan.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c index 968464c65b..639b7a1334 100644 --- a/libavcodec/xan.c +++ b/libavcodec/xan.c @@ -262,7 +262,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\n"); return ; } |