From fc4a51e3faa567fcbcbdc8202fc6e6a9aff2113c Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 7 Dec 2016 14:53:57 +0100 Subject: Fix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reading rest of the code, it's obvious we want to start à YOFF lines from start of rect2i, so we have to also multiply by number of components. Also did some minor cleanup. --- source/blender/blenkernel/intern/seqeffects.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/blender/blenkernel/intern/seqeffects.c') diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c index 802f0ffb518..298671beedb 100644 --- a/source/blender/blenkernel/intern/seqeffects.c +++ b/source/blender/blenkernel/intern/seqeffects.c @@ -1086,15 +1086,15 @@ static void do_drop_effect_byte(float facf0, float facf1, int x, int y, unsigned fac1 = (int) (70.0f * facf0); fac2 = (int) (70.0f * facf1); - rt2 = (unsigned char *) (rect2i + yoff * width); - rt1 = (unsigned char *) rect1i; - out = (unsigned char *) outi; + rt2 = rect2i + yoff * 4 * width; + rt1 = rect1i; + out = outi; for (y = 0; y < height - yoff; y++) { if (field) fac = fac1; else fac = fac2; field = !field; - memcpy(out, rt1, sizeof(int) * xoff); + memcpy(out, rt1, sizeof(*out) * xoff * 4); rt1 += xoff * 4; out += xoff * 4; @@ -1109,7 +1109,7 @@ static void do_drop_effect_byte(float facf0, float facf1, int x, int y, unsigned } rt2 += xoff * 4; } - memcpy(out, rt1, sizeof(int) * yoff * width); + memcpy(out, rt1, sizeof(*out) * yoff * 4 * width); } static void do_drop_effect_float(float facf0, float facf1, int x, int y, float *rect2i, float *rect1i, float *outi) @@ -1126,7 +1126,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y, float * fac1 = 70.0f * facf0; fac2 = 70.0f * facf1; - rt2 = (rect2i + yoff * width); + rt2 = rect2i + yoff * 4 * width; rt1 = rect1i; out = outi; for (y = 0; y < height - yoff; y++) { @@ -1134,7 +1134,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y, float * else fac = fac2; field = !field; - memcpy(out, rt1, 4 * sizeof(float) * xoff); + memcpy(out, rt1, sizeof(*out) * xoff * 4); rt1 += xoff * 4; out += xoff * 4; @@ -1149,7 +1149,7 @@ static void do_drop_effect_float(float facf0, float facf1, int x, int y, float * } rt2 += xoff * 4; } - memcpy(out, rt1, 4 * sizeof(float) * yoff * width); + memcpy(out, rt1, sizeof(*out) * yoff * 4 * width); } /*********************** Mul *************************/ -- cgit v1.2.3