diff --git a/r5dev/thirdparty/lzham/include/lzham_checksum.h b/r5dev/thirdparty/lzham/include/lzham_checksum.h
index 515f3389..aca03060 100644
--- a/r5dev/thirdparty/lzham/include/lzham_checksum.h
+++ b/r5dev/thirdparty/lzham/include/lzham_checksum.h
@@ -8,6 +8,6 @@ namespace lzham
    uint adler32(const void* pBuf, size_t buflen, uint adler32 = cInitAdler32);
    
    const uint cInitCRC32 = 0U;
-   uint crc32(uint crc, const lzham_uint8 *ptr, size_t buf_len);
+   uint crc32(const void* pBuf, size_t buflen, uint crc32 = cInitCRC32);
    
 }  // namespace lzham
diff --git a/r5dev/thirdparty/lzham/lzham_checksum.cpp b/r5dev/thirdparty/lzham/lzham_checksum.cpp
index 3dc616d4..ae262aea 100644
--- a/r5dev/thirdparty/lzham/lzham_checksum.cpp
+++ b/r5dev/thirdparty/lzham/lzham_checksum.cpp
@@ -53,19 +53,21 @@ namespace lzham
       0xedb88320, 0xf00f9344, 0xd6d6a3e8, 0xcb61b38c, 0x9b64c2b0, 0x86d3d2d4, 0xa00ae278, 0xbdbdf21c 
    };
    
-   uint crc32(uint crc, const lzham_uint8 *ptr, size_t buf_len)
+   uint crc32(const void* pBuf, size_t buflen, uint crc32)
    {
-      if (!ptr) 
+      if (!pBuf)
          return cInitCRC32;
 
-      crc = ~crc; 
-      while (buf_len--) 
+      crc32 = ~crc32;
+      const uint8* buffer = static_cast<const uint8*>(pBuf);
+
+      while (buflen--) 
       { 
-         lzham_uint8 b = *ptr++; 
-         crc = (crc >> 4) ^ s_crc32[(crc & 0xF) ^ (b & 0xF)]; 
-         crc = (crc >> 4) ^ s_crc32[(crc & 0xF) ^ (b >> 4)]; 
+         uint8 b = *buffer++;
+         crc32 = (crc32 >> 4) ^ s_crc32[(crc32 & 0xF) ^ (b & 0xF)];
+         crc32 = (crc32 >> 4) ^ s_crc32[(crc32 & 0xF) ^ (b >> 4)];
       }
-      return ~crc;
+      return ~crc32;
    }
 
   
diff --git a/r5dev/thirdparty/lzham/lzhamcomp/lzham_lzcomp_internal.cpp b/r5dev/thirdparty/lzham/lzhamcomp/lzham_lzcomp_internal.cpp
index 55ac4149..c2b4c61a 100644
--- a/r5dev/thirdparty/lzham/lzhamcomp/lzham_lzcomp_internal.cpp
+++ b/r5dev/thirdparty/lzham/lzhamcomp/lzham_lzcomp_internal.cpp
@@ -1547,7 +1547,7 @@ namespace lzham
       m_start_of_block_state = m_state;
 
       m_src_adler32 = adler32(pBuf, buf_len, m_src_adler32);
-      m_src_crc32 = crc32(m_src_adler32, (const lzham_uint8*)pBuf, buf_len);
+      m_src_crc32 = crc32(pBuf, buf_len, m_src_crc32);
 
       m_block_start_dict_ofs = m_accel.get_lookahead_pos() & (m_accel.get_max_dict_size() - 1);
 
diff --git a/r5dev/thirdparty/lzham/lzhamdecomp/lzham_decomp.h b/r5dev/thirdparty/lzham/lzhamdecomp/lzham_decomp.h
index fded67ce..39f97a5c 100644
--- a/r5dev/thirdparty/lzham/lzhamdecomp/lzham_decomp.h
+++ b/r5dev/thirdparty/lzham/lzhamdecomp/lzham_decomp.h
@@ -31,7 +31,7 @@ namespace lzham
    int LZHAM_CDECL lzham_lib_z_uncompress(unsigned char *pDest, lzham_z_ulong *pDest_len, const unsigned char *pSource, lzham_z_ulong source_len);
 
    const char * LZHAM_CDECL lzham_lib_z_error(int err);
-   lzham_z_ulong lzham_lib_z_adler32(lzham_z_ulong adler, const unsigned char *ptr, size_t buf_len);
+   lzham_z_ulong LZHAM_CDECL lzham_lib_z_adler32(lzham_z_ulong adler, const lzham_uint8*ptr, size_t buf_len);
    lzham_z_ulong LZHAM_CDECL lzham_lib_z_crc32(lzham_z_ulong crc, const lzham_uint8 *ptr, size_t buf_len);
 
 } // namespace lzham
diff --git a/r5dev/thirdparty/lzham/lzhamdecomp/lzham_lzdecomp.cpp b/r5dev/thirdparty/lzham/lzhamdecomp/lzham_lzdecomp.cpp
index f5fa9093..bc07b4a7 100644
--- a/r5dev/thirdparty/lzham/lzhamdecomp/lzham_lzdecomp.cpp
+++ b/r5dev/thirdparty/lzham/lzhamdecomp/lzham_lzdecomp.cpp
@@ -193,7 +193,7 @@ namespace lzham
                size_t bytes_to_copy = LZHAM_MIN((size_t)(m_flush_n - copy_ofs), cBytesToMemCpyPerIteration); \
                LZHAM_MEMCPY(m_pOut_buf + copy_ofs, m_pFlush_src + copy_ofs, bytes_to_copy); \
                m_decomp_adler32 = adler32(m_pFlush_src + copy_ofs, bytes_to_copy, m_decomp_adler32); \
-               m_decomp_crc32 = crc32(m_decomp_crc32, m_pFlush_src + copy_ofs, bytes_to_copy); \
+               m_decomp_crc32 = crc32(m_pFlush_src + copy_ofs, bytes_to_copy, m_decomp_crc32); \
                copy_ofs += bytes_to_copy; \
             } \
          } \
@@ -1146,7 +1146,7 @@ namespace lzham
          {
              if (unbuffered)
              {
-                 m_decomp_crc32 = crc32(cInitCRC32, pDst, dst_ofs);
+                 m_decomp_crc32 = crc32(pDst, dst_ofs, cInitCRC32);
              }
 
              //if (m_file_src_file_crc32 != m_decomp_crc32)
@@ -1576,14 +1576,14 @@ namespace lzham
       return NULL;
    }
 
-   lzham_z_ulong lzham_lib_z_adler32(lzham_z_ulong adler, const unsigned char *ptr, size_t buf_len)
+   lzham_z_ulong LZHAM_CDECL lzham_lib_z_adler32(lzham_z_ulong adler, const lzham_uint8 *ptr, size_t buf_len)
    {
       return adler32(ptr, buf_len, adler);
    }
 
    lzham_z_ulong LZHAM_CDECL lzham_lib_z_crc32(lzham_z_ulong crc, const lzham_uint8 *ptr, size_t buf_len)
    {
-      return crc32(crc, ptr, buf_len);
+      return crc32(ptr, buf_len, crc);
    }
 
 } // namespace lzham