Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions gzlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -385,9 +385,11 @@ z_off64_t ZEXPORT gzseek64(gzFile file, z_off64_t offset, int whence) {
return -1;

/* normalize offset to a SEEK_CUR specification */
if (whence == SEEK_SET)
if (whence == SEEK_SET) {
if (offset < 0)
return -1;
offset -= state->x.pos;
else {
} else {
offset += state->past ? 0 : state->skip;
state->skip = 0;
}
Expand Down