Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2016-12-07 16:53:57 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-12-07 16:53:57 +0300
commitfc4a51e3faa567fcbcbdc8202fc6e6a9aff2113c (patch)
tree6212a2ab157c3137641aece2e6492e4e6ae3deaa /source/blender/blenkernel/intern/seqeffects.c
parent8f29503b523f243ae00db9a490927e628e4bdc91 (diff)
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.
Diffstat (limited to 'source/blender/blenkernel/intern/seqeffects.c')
-rw-r--r--source/blender/blenkernel/intern/seqeffects.c16
1 files changed, 8 insertions, 8 deletions
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 *************************/