patch
1169934 by Artur Kornacki
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33040
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
//
wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
{
//
wxFileOffset wxZipInputStream::OnSysSeek(wxFileOffset seek, wxSeekMode mode)
{
- if (!m_ffile || AtHeader())
+ if (!m_ffile)
+ return wxInvalidOffset;
+ if (!IsOpened())
+ if ((AtHeader() && !DoOpen()) || !OpenDecompressor())
+ m_lasterror = wxSTREAM_READ_ERROR;
+ if (!IsOk())
return wxInvalidOffset;
// NB: since ZIP files don't natively support seeking, we have to
return wxInvalidOffset;
// NB: since ZIP files don't natively support seeking, we have to
{
case wxFromCurrent : nextpos = seek + pos; break;
case wxFromStart : nextpos = seek; break;
{
case wxFromCurrent : nextpos = seek + pos; break;
case wxFromStart : nextpos = seek; break;
- case wxFromEnd : nextpos = GetLength() - 1 + seek; break;
+ case wxFromEnd : nextpos = GetLength() + seek; break;
default : nextpos = pos; break; /* just to fool compiler, never happens */
}
default : nextpos = pos; break; /* just to fool compiler, never happens */
}