summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorPedro J. Estébanez <pedrojrulez@gmail.com>2016-06-13 00:19:45 +0200
committerPedro J. Estébanez <pedrojrulez@gmail.com>2016-06-13 00:19:45 +0200
commite1948d520af3df173e33bc46087b1717215293dd (patch)
treec2cd44fba20772a538335b4f6ebb2f3ab72dcd36 /core
parent1b189ad9435b6b119a594c4972aee88bc3ca3e29 (diff)
Zip-align exported APK
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)