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); }