tvg_loader: resolve sanitizer report.

"runtime error: load of misaligned address 0x7fb67895c815 for type 'unsigned int', which requires 4 byte alignment"

This is actually not an issue but we can resolve it with an easy workaround,
since we don't need to see this report repeatedly.
This commit is contained in:
Hermet Park 2021-09-24 11:53:46 +09:00
parent 9128272ee3
commit c8cc973888

View file

@ -79,18 +79,18 @@ bool TvgLoader::readHeader()
//5. Compressed Size if any
if (compressed) {
auto p = reinterpret_cast<TvgBinCounter*>(const_cast<char*>(ptr));
auto p = ptr;
//TVG_HEADER_UNCOMPRESSED_SIZE
uncompressedSize = *static_cast<uint32_t*>(p);
++p;
memcpy(&uncompressedSize, p, sizeof(uint32_t));
p += SIZE(uint32_t);
//TVG_HEADER_COMPRESSED_SIZE
compressedSize = *static_cast<uint32_t*>(p);
++p;
memcpy(&compressedSize, p, sizeof(uint32_t));
p += SIZE(uint32_t);
//TVG_HEADER_COMPRESSED_SIZE_BITS
compressedSizeBits = *static_cast<uint32_t*>(p);
memcpy(&compressedSizeBits, p, sizeof(uint32_t));
}
ptr += TVG_HEADER_COMPRESS_SIZE;