From: Steinar H. Gunderson Date: Mon, 6 Jun 2016 17:04:25 +0000 (+0200) Subject: Fix an off-by-one copy in memcpy_interleaved_fastpath(). X-Git-Tag: 1.3.0~9 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=11e5d7e8d001e32d4f2d634736dda28d643b2bad;p=nageru Fix an off-by-one copy in memcpy_interleaved_fastpath(). Found by Coverity Scan. --- diff --git a/decklink_capture.cpp b/decklink_capture.cpp index 2519caa..e57b5d4 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -58,7 +58,7 @@ size_t memcpy_interleaved_fastpath(uint8_t *dest1, uint8_t *dest2, const uint8_t memcpy_interleaved(dest1, dest2, src, n2); dest1 += n2 / 2; dest2 += n2 / 2; - if (n2 % 1) { + if (n2 % 2) { swap(dest1, dest2); } src = aligned_src;