https://bugs.kde.org/show_bug.cgi?id=372023

Nikita Melnichenko <nikita+...@melnichenko.name> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
      Latest Commit|                            |https://commits.kde.org/kru
                   |                            |sader/c33f9629c7e313be9e8bd
                   |                            |de0579e00a5f98fad39
         Resolution|---                         |FIXED

--- Comment #14 from Nikita Melnichenko <nikita+...@melnichenko.name> ---
Git commit c33f9629c7e313be9e8bdde0579e00a5f98fad39 by Nikita Melnichenko.
Committed on 22/06/2018 at 07:44.
Pushed by melnichenko into branch 'master'.

KIso: Fixed file offsets of the underlying IO device

The patch is proposed by Theo <alpha0...@yahoo.de>.

kio_iso uses KArchive's KCompressionDevice to access the ISO file.
The device is created in KIso::prepareDevice and KCompressionDevice's
constructor creates a QIODevice and a QFileDevice. The corresponding
*Private devices have separate sets of member variables 'pos' and
'devicePos' that get out of sync when the QFileDevice is closed at the end
of KIso::openArchive. The QFileDevice is reset to offset zero while
QIODevice keeps the offset positions it has after reading the ISO file
system. When the ISO file is opened for reading the file data,
QFileDevice's offset positions are treated as if they haven't been reset
and subsequent seeks fall short of the requested offset.

The workaround is suggested by Qt documentation [1]
"When subclassing QIODevice, you must call QIODevice::seek() at the start
of your function to ensure integrity with QIODevice's built-in buffer."

For more details see the discussion in the bug.

FIXED: [ 372023 ] ISO files listing/extracting broken

Differential Revision: https://phabricator.kde.org/D13626

[1] http://doc.qt.io/qt-5/qiodevice.html#seek

M  +7    -1    iso/iso.cpp
M  +4    -0    iso/kiso.cpp

https://commits.kde.org/krusader/c33f9629c7e313be9e8bdde0579e00a5f98fad39

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to