Commit 9222965f authored by George Floarea's avatar George Floarea Committed by Paul B Mahol

avfilter/vf_xfade: fix zx and zy comparison for slide*

This resulted in the wrong column/row being chosen.
This can be seen best when using xfade on streams with transparency.

For example: in case of a slideleft transition, the first column from
the first input will overwrite the first column of the second stream
throught the transition.
parent eb7ab392
......@@ -433,7 +433,7 @@ static void slideleft##name##_transition(AVFilterContext *ctx,
for (int x = 0; x < width; x++) { \
const int zx = z + x; \
const int zz = zx % width + width * (zx < 0); \
dst[x] = (zx > 0) && (zx < width) ? xf1[zz] : xf0[zz]; \
dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \
} \
\
dst += out->linesize[p] / div; \
......@@ -466,7 +466,7 @@ static void slideright##name##_transition(AVFilterContext *ctx,
for (int x = 0; x < out->width; x++) { \
const int zx = z + x; \
const int zz = zx % width + width * (zx < 0); \
dst[x] = (zx > 0) && (zx < width) ? xf1[zz] : xf0[zz]; \
dst[x] = (zx >= 0) && (zx < width) ? xf1[zz] : xf0[zz]; \
} \
\
dst += out->linesize[p] / div; \
......@@ -499,7 +499,7 @@ static void slideup##name##_transition(AVFilterContext *ctx,
const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \
\
for (int x = 0; x < out->width; x++) { \
dst[x] = (zy > 0) && (zy < height) ? xf1[x] : xf0[x]; \
dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
......@@ -530,7 +530,7 @@ static void slidedown##name##_transition(AVFilterContext *ctx,
const type *xf1 = (const type *)(b->data[p] + zz * b->linesize[p]); \
\
for (int x = 0; x < out->width; x++) { \
dst[x] = (zy > 0) && (zy < height) ? xf1[x] : xf0[x]; \
dst[x] = (zy >= 0) && (zy < height) ? xf1[x] : xf0[x]; \
} \
\
dst += out->linesize[p] / div; \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment