From fe39a4db50f5a2188680e2cd56e059ff330b37fa Mon Sep 17 00:00:00 2001 From: "jijoong.moon" Date: Tue, 5 Jun 2018 17:51:48 +0900 Subject: [PATCH] [Bug Fix] Using memmove for in-place calculation Sometimes there is undefined behavior when the source and destination overlaped. In this case, we have to use memmove to handle overlapping regions. Signed-off-by: jijoong.moon --- tensor_converter/tensor_converter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tensor_converter/tensor_converter.c b/tensor_converter/tensor_converter.c index fb97660..01f3976 100644 --- a/tensor_converter/tensor_converter.c +++ b/tensor_converter/tensor_converter.c @@ -528,7 +528,7 @@ static GstFlowReturn gst_tensor_converter_transform_ip(GstBaseTransform *trans, g_assert(d0 == 0); for (row = 0; row < filter->dimension[2]; row++) { // Height if (dest_idx != src_idx) - memcpy(ptr + dest_idx, ptr + src_idx, size); + memmove(ptr + dest_idx, ptr + src_idx, size); dest_idx += size; src_idx += offset; } -- 2.7.4