Skip to content

Allow KCompressionDevice to return a non 0 size

Albert Astals Cid requested to merge work/aacid/knownsize_kcompression into master

And set it from KKZipFileEntry::createDevice

This comes up from investigating that ended up with me proposing

In short the png handler has a workaround from broken files and does something like if (condition && size - pos < 4 && reading_length == 4) and triggers a workaround, problem is since that KCompressionDevice size is always 0, every time it reads 4 (and we're in condition) it fails.

The problem i see with this patch is that probably one could create "malformed" zip files that report the incorrect size and i don't know what would happen.

Besides given the whole thing is a bit fishy I think I'm going to change the Okular code to just read the whole image at one, save it in a buffer, and then pass it to qimagereader and it will work.

So I'm more opening this for showing that there may be something that needs improvement more than for that i think this is the real real fix.

Comments welcome, if not i'll close the MR at some point :)

Merge request reports