summaryrefslogtreecommitdiffstatshomepage
path: root/src/osd/modules/render/bgfx/valueuniform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/osd/modules/render/bgfx/valueuniform.cpp')
-rw-r--r--src/osd/modules/render/bgfx/valueuniform.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/osd/modules/render/bgfx/valueuniform.cpp b/src/osd/modules/render/bgfx/valueuniform.cpp
index 8a018ac492a..e36ee3cbca8 100644
--- a/src/osd/modules/render/bgfx/valueuniform.cpp
+++ b/src/osd/modules/render/bgfx/valueuniform.cpp
@@ -10,13 +10,17 @@
//============================================================
#include "valueuniform.h"
-#include <cstring>
-bgfx_value_uniform::bgfx_value_uniform(bgfx_uniform* uniform, float* values, const int count)
+#include <algorithm>
+#include <cassert>
+
+
+bgfx_value_uniform::bgfx_value_uniform(bgfx_uniform* uniform, const float* values, const int count)
: bgfx_entry_uniform(uniform)
, m_count(count)
{
- memcpy(m_values, values, sizeof(float) * count);
+ assert(count <= std::size(m_values));
+ std::copy_n(values, count, m_values);
}
void bgfx_value_uniform::bind()