]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - fs.c
More coverity.
[xonotic/darkplaces.git] / fs.c
diff --git a/fs.c b/fs.c
index 994155aa290fe5ad69bb3b05e7531ae28995b64d..67d65713f498da5fb495fd50cbc74e17004dfe18 100644 (file)
--- a/fs.c
+++ b/fs.c
@@ -797,7 +797,11 @@ static qboolean PK3_GetTrueFileOffset (packfile_t *pfile, pack_t *pack)
                return true;
 
        // Load the local file description
-       lseek (pack->handle, pfile->offset, SEEK_SET);
+       if (lseek (pack->handle, pfile->offset, SEEK_SET) == -1)
+       {
+               Con_Printf ("Can't seek in package %s\n", pack->filename);
+               return false;
+       }
        count = read (pack->handle, buffer, ZIP_LOCAL_CHUNK_BASE_SIZE);
        if (count != ZIP_LOCAL_CHUNK_BASE_SIZE || BuffBigLong (buffer) != ZIP_DATA_HEADER)
        {