buggins / coolreader

Official site of CoolReader project. Sourceforge repository is obsolete.
GNU General Public License v2.0
374 stars 100 forks source link

ZIP64 fixes & other... #312

Closed virxkane closed 3 years ago

virxkane commented 3 years ago

ZIP64 fixes:

Other:

poire-z commented 3 years ago

(Put back as draft because you have doubts about the fix ? Or just because you plan on adding more (related? unrelated?) commits to this PR? Just wondering if I can merge mine or if I should wait :)

virxkane commented 3 years ago

(Put back as draft because you have doubts about the fix ? Or just because you plan on adding more

Plan adding some commits (or one) to fully (or not full but more closer) support of zip64 feature.

poire-z commented 3 years ago

Just asking because your last changes are too big for me to dig into :)

If zip64 signature found but 'large file support' is disabled don't try to scan zip as broken file.

Can we have a zip64 signature with < 4GB files and normal EPUBs/FB2.ZIP which are usually smaller - or is it assured you won't get that signature until you reach 4GB and the need for it ? And so, do "scan zip as broken" will still always work with smaller files (if we don't #define 'large file support') ?

Also, is your first zip64 commit in the other PR + your fix in the first commit here still just fine, and I can pick them safely ? Or did you fix some of the stuff they did with the commits you just added ? Just asking if I can go on with them in my PR, or better keep them out till I get a chance to pick them all and do again some testing :)

virxkane commented 3 years ago

Can we have a zip64 signature with < 4GB files and normal EPUBs/FB2.ZIP which are usually smaller

Usually not.

or is it assured you won't get that signature until you reach 4GB and the need for it ?

Yes. Also if zip file is large than 4G, 'End of central directory record' have special version and it's also signature of the zip64.

And so, do "scan zip as broken" will still always work with smaller files (if we don't #define 'large file support') ?

I think, yes. Edit: tested, it works on small files with or without large file support.

Also, is your first zip64 commit in the other PR + your fix in the first commit here still just fine, and I can pick them safely ? Or did you fix some of the stuff they did with the commits you just added ?

If you pick only this two commits, then you can't read/extract inner files beyond 4G limit in such archives.