mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-23 20:33:05 +00:00
Improper use of a possible negative value.
This commit is contained in:
parent
ce23e95d0b
commit
1929b129ee
1 changed files with 9 additions and 1 deletions
10
pak.c
10
pak.c
|
@ -427,8 +427,16 @@ static bool pak_close(pak_file_t *pak) {
|
|||
* our directory entries at the end of the file.
|
||||
*/
|
||||
if (pak->insert) {
|
||||
int tell = fs_file_tell(pak->handle);
|
||||
if (tell < 0) {
|
||||
vec_free (pak->directories);
|
||||
fs_file_close(pak->handle);
|
||||
mem_d (pak);
|
||||
|
||||
return false;
|
||||
}
|
||||
pak->header.dirlen = vec_size(pak->directories) * 64;
|
||||
pak->header.diroff = ftell(pak->handle);
|
||||
pak->header.diroff = tell;
|
||||
|
||||
/* patch header */
|
||||
fs_file_seek (pak->handle, 0, SEEK_SET);
|
||||
|
|
Loading…
Reference in a new issue