Commit a254f5a3 authored by Max Kellermann's avatar Max Kellermann

archive/zzip: fix inverted error handler

Set the Error when zzip_seek()==-1 and not on success. Fixes a crash after seeking.
parent 143c735f
ver 0.18.19 (not yet released) ver 0.18.19 (not yet released)
* archive
- zzip: fix crash after seeking
ver 0.18.18 (2014/11/18) ver 0.18.18 (2014/11/18)
* decoder * decoder
......
...@@ -186,12 +186,13 @@ zzip_input_seek(InputStream *is, InputPlugin::offset_type offset, ...@@ -186,12 +186,13 @@ zzip_input_seek(InputStream *is, InputPlugin::offset_type offset,
{ {
ZzipInputStream *zis = (ZzipInputStream *)is; ZzipInputStream *zis = (ZzipInputStream *)is;
zzip_off_t ofs = zzip_seek(zis->file, offset, whence); zzip_off_t ofs = zzip_seek(zis->file, offset, whence);
if (ofs != -1) { if (ofs < 0) {
error.Set(zzip_domain, "zzip_seek() has failed"); error.Set(zzip_domain, "zzip_seek() has failed");
is->offset = ofs; return false;
return true;
} }
return false;
is->offset = ofs;
return true;
} }
/* exported structures */ /* exported structures */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment