mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
tvg_saver: resolve sanitizer report.
"runtime error: load of misaligned address 0x7fb67895c815 for type 'unsigned int', which requires 4 byte alignment"
same to c8cc973888
This commit is contained in:
parent
3ee6883f16
commit
daa114aafa
1 changed files with 3 additions and 3 deletions
|
@ -164,15 +164,15 @@ bool TvgSaver::saveEncoding(const std::string& path)
|
|||
uncompressed += TVG_HEADER_RESERVED_LENGTH;
|
||||
|
||||
//Uncompressed Size
|
||||
*reinterpret_cast<TvgBinCounter*>(uncompressed) = uncompressedSize;
|
||||
memcpy(uncompressed, &uncompressedSize, TVG_HEADER_UNCOMPRESSED_SIZE);
|
||||
uncompressed += TVG_HEADER_UNCOMPRESSED_SIZE;
|
||||
|
||||
//Comprssed Size
|
||||
*reinterpret_cast<TvgBinCounter*>(uncompressed) = compressedSize;
|
||||
memcpy(uncompressed, &compressedSize, TVG_HEADER_COMPRESSED_SIZE);
|
||||
uncompressed += TVG_HEADER_COMPRESSED_SIZE;
|
||||
|
||||
//Compressed Size Bits
|
||||
*reinterpret_cast<TvgBinCounter*>(uncompressed) = compressedSizeBits;
|
||||
memcpy(uncompressed, &compressedSizeBits, TVG_HEADER_COMPRESSED_SIZE_BITS);
|
||||
|
||||
//Good optimization, flush to file.
|
||||
auto fp = fopen(path.c_str(), "w+");
|
||||
|
|
Loading…
Add table
Reference in a new issue