summaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-04-18 00:52:48 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-04-18 01:55:42 +0200
commitbdfe60c769f4d4e71a360fe02f06cdb9c039cf35 (patch)
treeeee24c44b2cf439f947fecf4dbc743d379914bdd /libavcodec
parent32cc7ba8a70a630a3e531195a6612888bc982ddb (diff)
downloadffmpeg-streaming-bdfe60c769f4d4e71a360fe02f06cdb9c039cf35.zip
ffmpeg-streaming-bdfe60c769f4d4e71a360fe02f06cdb9c039cf35.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>
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/xan.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavcodec/xan.c b/libavcodec/xan.c
index 2758352..41925aa 100644
--- a/libavcodec/xan.c
+++ b/libavcodec/xan.c
@@ -249,6 +249,12 @@ static inline void xan_wc3_copy_pixel_run(XanContext *s, AVFrame *frame,
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) {
+ avpriv_request_sample(s->avctx, "Overlapping copy\n");
+ return ;
+ }
+
while (pixel_count &&
curframe_index < s->frame_size &&
prevframe_index < s->frame_size) {
OpenPOWER on IntegriCloud