[Bf-blender-cvs] [fc4a51e] master: Fix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer.

Bastien Montagne noreply at git.blender.org
Wed Dec 7 14:56:40 CET 2016


Commit: fc4a51e3faa567fcbcbdc8202fc6e6a9aff2113c
Author: Bastien Montagne
Date:   Wed Dec 7 14:53:57 2016 +0100
Branches: master
https://developer.blender.org/rBfc4a51e3faa567fcbcbdc8202fc6e6a9aff2113c

Fix (unreported) Sequencer Drop effect: wrong initial offset in second input buffer.

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.

===================================================================

M	source/blender/blenkernel/intern/seqeffects.c

===================================================================

diff --git a/source/blender/blenkernel/intern/seqeffects.c b/source/blender/blenkernel/intern/seqeffects.c
index 802f0ff..298671b 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 *************************/




More information about the Bf-blender-cvs mailing list