From 57d9938c7a0dcce7ca2a77b62c19d05a3df0af0b Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Sun, 29 Jan 2023 07:20:51 +1100 Subject: render/bgfx: Fixed Linux build. --- src/osd/modules/render/bgfx/valueuniform.cpp | 8 ++++++-- src/osd/modules/render/bgfx/valueuniform.h | 2 +- 2 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 3119dbde4fc..e36ee3cbca8 100644 --- a/src/osd/modules/render/bgfx/valueuniform.cpp +++ b/src/osd/modules/render/bgfx/valueuniform.cpp @@ -11,12 +11,16 @@ #include "valueuniform.h" +#include +#include -bgfx_value_uniform::bgfx_value_uniform(bgfx_uniform* uniform, float* values, const int count) + +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() diff --git a/src/osd/modules/render/bgfx/valueuniform.h b/src/osd/modules/render/bgfx/valueuniform.h index e265fb91200..aa8139650a3 100644 --- a/src/osd/modules/render/bgfx/valueuniform.h +++ b/src/osd/modules/render/bgfx/valueuniform.h @@ -19,7 +19,7 @@ class bgfx_value_uniform : public bgfx_entry_uniform { public: - bgfx_value_uniform(bgfx_uniform* uniform, float* values, const int count); + bgfx_value_uniform(bgfx_uniform* uniform, const float* values, const int count); virtual void bind() override; -- cgit v1.2.3