Skip to content

Commit

Permalink
Fixed Linux build
Browse files Browse the repository at this point in the history
  • Loading branch information
AideTechBot committed Dec 18, 2020
1 parent 10f3e64 commit 28fa4bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions brs/brs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,8 +746,8 @@ namespace BRS {
inline BRS::buffer Reader::read_compressed()
{
// represents compressed and uncompressed block sizes
int32_t uncompressed_size = read_uint32(reader_);
int32_t compressed_size = read_uint32(reader_);
uint32_t uncompressed_size = read_uint32(reader_);
uint32_t compressed_size = read_uint32(reader_);

// Throw error for weird compression/uncompression sizes
if (compressed_size < 0 || uncompressed_size < 0 || compressed_size >= uncompressed_size)
Expand All @@ -766,7 +766,9 @@ namespace BRS {

reader_.read(reinterpret_cast<char*>(src), compressed_size);

int cmp_status = uncompress(dest, reinterpret_cast<mz_ulong*>(&uncompressed_size), src, static_cast<mz_ulong>(compressed_size));
mz_ulong us = static_cast<mz_ulong>(uncompressed_size);
int cmp_status = uncompress(dest, &us, src, static_cast<mz_ulong>(compressed_size));

delete[] src;

if(cmp_status != Z_OK)
Expand Down

0 comments on commit 28fa4bc

Please sign in to comment.