- if (stream.SeekI(wxUINT32_SWAP_ON_BE(pCurrentEntry->dwImageOffset) - offset,
- wxFromCurrent) == wxInvalidOffset)
+ wxFileOffset offset = wxUINT32_SWAP_ON_BE(pCurrentEntry->dwImageOffset) - alreadySeeked;
+ if (offset != 0 && stream.SeekI(offset, wxFromCurrent) == wxInvalidOffset)