aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-18 00:52:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-01-16 00:35:12 +0100
commitc93501687ca940cba649aea4ae9512c76555deb8 (patch)
tree7ba124867027824ddf58d186e62c769ec88e3705
parentbb6f4667946c7e4b5e99971a60040c9adedee84b (diff)
downloadffmpeg-c93501687ca940cba649aea4ae9512c76555deb8.tar.gz
xan: Check for overlapping copies
No valid samples i found use such copies Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit bdfe60c769f4d4e71a360fe02f06cdb9c039cf35) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/xan.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 219eedd92d..6bfb4ba7bd 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -244,6 +244,11 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s, int x, int y,
curframe_x = x;
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) {
+ return ;
+ }
+
while (pixel_count &&
curframe_index < s->frame_size &&
prevframe_index < s->frame_size) {