aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefano Sabatini <stefasab@gmail.com>2011-10-23 23:51:33 +0200
committerStefano Sabatini <stefasab@gmail.com>2011-10-23 23:54:37 +0200
commit42d44ec306d0656ace5cea63867f70fa686141cb (patch)
tree89a575dcaaaf78ff4672bdf334d0f29399475c9d
parent1679a40b74102f969404564518b77001ac0a5092 (diff)
downloadffmpeg-42d44ec306d0656ace5cea63867f70fa686141cb.tar.gz
vsrc_testsrc: do not assume non-padded lines in test_fill_picture()
In particular, fix sliding color bar with padded data, for example with testsrc,pad=iw+200:ih.
-rw-r--r--libavfilter/vsrc_testsrc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavfilter/vsrc_testsrc.c b/libavfilter/vsrc_testsrc.c
index 2447cb355c..47b045a1ce 100644
--- a/libavfilter/vsrc_testsrc.c
+++ b/libavfilter/vsrc_testsrc.c
@@ -283,7 +283,7 @@ static void test_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
}
/* draw sliding color line */
- p = data + picref->linesize[0] * height * 3/4;
+ p0 = p = data + picref->linesize[0] * height * 3/4;
grad = (256 * test->nb_frame * test->time_base.num / test->time_base.den) %
GRADIENT_SIZE;
rgrad = 0;
@@ -311,8 +311,9 @@ static void test_fill_picture(AVFilterContext *ctx, AVFilterBufferRef *picref)
if (grad >= GRADIENT_SIZE)
grad -= GRADIENT_SIZE;
}
+ p = p0;
for (y = height / 8; y > 0; y--) {
- memcpy(p, p - picref->linesize[0], 3 * width);
+ memcpy(p+picref->linesize[0], p, 3 * width);
p += picref->linesize[0];
}