diff --git a/programs/fileio.c b/programs/fileio.c index 3db6af734..9f9b72fb0 100644 --- a/programs/fileio.c +++ b/programs/fileio.c @@ -1038,7 +1038,7 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){ /* Skippable frame */ else if ((magicNumber & 0xFFFFFFF0U) == ZSTD_MAGIC_SKIPPABLE_START) { U32 const frameSize = MEM_readLE32(headerBuffer + 4); - long const seek = -numBytesRead + 8 + frameSize; + long const seek = (long)(8 + frameSize - numBytesRead); int const ret = LONG_SEEK(srcFile, seek, SEEK_CUR); if (ret != 0) { DISPLAY("Error: could not find end of skippable frame\n");