From 54012df3a1ad004cd42dcf977eb4980d0e147d5a Mon Sep 17 00:00:00 2001 From: karutoh Date: Mon, 19 Feb 2024 22:58:59 -0800 Subject: [PATCH] Fixed `Serializer::WriteArray(const T* const value, const O size)` and `FontAtlas(const Str_8& filePath)`. --- include/ehs/Serializer.h | 2 +- src/io/FontAtlas.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/ehs/Serializer.h b/include/ehs/Serializer.h index e3e1c12..d832308 100644 --- a/include/ehs/Serializer.h +++ b/include/ehs/Serializer.h @@ -194,7 +194,7 @@ namespace ehs Byte* r = new Byte[this->size + remainder]; - Util::Copy(r, data, size); + Util::Copy(r, data, this->size); delete[] data; data = r; diff --git a/src/io/FontAtlas.cpp b/src/io/FontAtlas.cpp index a006829..36e8dcf 100644 --- a/src/io/FontAtlas.cpp +++ b/src/io/FontAtlas.cpp @@ -40,8 +40,8 @@ namespace ehs glyphs[i] = Glyph(fData); resolution = fData.ReadVec2(); - size = resolution.x * resolution.y; - atlas = new Byte[size]; + atlas = new Byte[resolution.x * resolution.y]; + size = 0; fData.ReadArray(atlas, &size); }