]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
Use correct types in LZMA comp/decomp (#3497)
authorAlex Xu <351006+Hello71@users.noreply.github.com>
Tue, 14 Feb 2023 00:30:56 +0000 (00:30 +0000)
committerGitHub <noreply@github.com>
Tue, 14 Feb 2023 00:30:56 +0000 (16:30 -0800)
Bytef and uInt are zlib types, not available when zlib is disabled

Fixes: 1598e6c634ac ("Async write for decompression")
Fixes: cc0657f27d81 ("AsyncIO compression part 2 - added async read and asyncio to compression code (#3022)")
programs/fileio.c

index 9a8300cdd834209d049cacf3debc69a766344c87..d3ed9217d5c954dc3e86637d436a66041f4c61ab 100644 (file)
@@ -1173,8 +1173,8 @@ FIO_compressLzmaFrame(cRess_t* ress,
     }
 
     writeJob =AIO_WritePool_acquireJob(ress->writeCtx);
-    strm.next_out = (Bytef*)writeJob->buffer;
-    strm.avail_out = (uInt)writeJob->bufferSize;
+    strm.next_out = (BYTE*)writeJob->buffer;
+    strm.avail_out = writeJob->bufferSize;
     strm.next_in = 0;
     strm.avail_in = 0;
 
@@ -1201,7 +1201,7 @@ FIO_compressLzmaFrame(cRess_t* ress,
                 writeJob->usedBufferSize = compBytes;
                 AIO_WritePool_enqueueAndReacquireWriteJob(&writeJob);
                 outFileSize += compBytes;
-                strm.next_out = (Bytef*)writeJob->buffer;
+                strm.next_out = (BYTE*)writeJob->buffer;
                 strm.avail_out = writeJob->bufferSize;
         }   }
         if (srcFileSize == UTIL_FILESIZE_UNKNOWN)
@@ -2316,8 +2316,8 @@ FIO_decompressLzmaFrame(dRess_t* ress,
     }
 
     writeJob = AIO_WritePool_acquireJob(ress->writeCtx);
-    strm.next_out = (Bytef*)writeJob->buffer;
-    strm.avail_out = (uInt)writeJob->bufferSize;
+    strm.next_out = (BYTE*)writeJob->buffer;
+    strm.avail_out = writeJob->bufferSize;
     strm.next_in = (BYTE const*)ress->readCtx->srcBuffer;
     strm.avail_in = ress->readCtx->srcBufferLoaded;
 
@@ -2345,7 +2345,7 @@ FIO_decompressLzmaFrame(dRess_t* ress,
                 writeJob->usedBufferSize = decompBytes;
                 AIO_WritePool_enqueueAndReacquireWriteJob(&writeJob);
                 outFileSize += decompBytes;
-                strm.next_out = (Bytef*)writeJob->buffer;
+                strm.next_out = (BYTE*)writeJob->buffer;
                 strm.avail_out = writeJob->bufferSize;
         }   }
         if (ret == LZMA_STREAM_END) break;