lavfi/tests: Fix 16-bit vf_blend test to avoid memory not aligned to 2 bytes

Generic C implementation of vf_blend performs reads and writes of 16-bit
elements, which requires the buffers to be aligned to at least 2-byte
boundary.

Also, the change fixes source buffer overrun caused by src_offset being
added to to test handling of misaligned buffers.

Fixes: #7226

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Andrey Semashev 2018-05-24 00:07:36 +03:00 committed by Michael Niedermayer
parent 500e638711
commit d7eb8d8475

View File

@ -71,7 +71,7 @@
w = WIDTH / depth; \
\
for (i = 0; i < BUF_UNITS - 1; i++) { \
int src_offset = i * SIZE_PER_UNIT + i; /* Test various alignments */ \
int src_offset = i * SIZE_PER_UNIT + (BUF_UNITS - 1 - i) * depth; /* Test various alignments */ \
int dst_offset = i * SIZE_PER_UNIT; /* dst must be aligned */ \
randomize_buffers(); \
call_ref(top1 + src_offset, w, bot1 + src_offset, w, \