Browse Source

Fix incorrect size in memcpy (copyAndReturn)

Filip Klembara 4 years ago
parent
commit
e6a9650523
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/capi.cpp

+ 1 - 1
src/capi.cpp

@@ -275,7 +275,7 @@ int copyAndReturn(std::vector<T> b, T *buffer, int size) {
 
 
 	if (size < int(b.size()))
 	if (size < int(b.size()))
 		return RTC_ERR_TOO_SMALL;
 		return RTC_ERR_TOO_SMALL;
-	memcpy(buffer, b.data(), size * sizeof(*buffer));
+	memcpy(buffer, b.data(), b.size() * sizeof(*buffer));
 	return int(b.size());
 	return int(b.size());
 }
 }