summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-13 15:06:37 -0300
committerGitHub <noreply@github.com>2016-06-13 15:06:37 -0300
commit5f674bdca1dafd7073c769a3830dac15f5dbc9d6 (patch)
tree3945ff2fc78dd04d6777ee854f4658e07f04a10d /core
parent20b45678293551f9fdb5a4b13ec1d5871a3d9cf8 (diff)
parente1948d520af3df173e33bc46087b1717215293dd (diff)
Merge pull request #5179 from RandomShaper/better-android-export
Enhanced Android export
Diffstat (limited to 'core')
-rw-r--r--core/io/unzip.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/core/io/unzip.c b/core/io/unzip.c
index 78672677f9..7aa0a86d13 100644
--- a/core/io/unzip.c
+++ b/core/io/unzip.c
@@ -1031,10 +1031,19 @@ local int unz64local_GetCurrentFileInfoInternal (unzFile file,
if (lSeek!=0)
{
- if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
- lSeek=0;
- else
- err=UNZ_ERRNO;
+ if (lSeek<0) {
+ // WORKAROUND for backwards seeking
+ z_off_t pos = ZTELL64(s->z_filefunc, s->filestream);
+ if (ZSEEK64(s->z_filefunc, s->filestream,pos+lSeek,ZLIB_FILEFUNC_SEEK_SET)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ } else {
+ if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0)
+ lSeek=0;
+ else
+ err=UNZ_ERRNO;
+ }
}
while(acc < file_info.size_file_extra)