mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 21:53:41 +00:00
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:
parent
9128272ee3
commit
c8cc973888
1 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue