X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8e50d1add66530dda0e9e42906e25cbe6f8f3449..d36c9347ea16171bc2f855076d8b9b11801ec622:/src/common/zstream.cpp diff --git a/src/common/zstream.cpp b/src/common/zstream.cpp index 083ac372fb..0b4878cf91 100644 --- a/src/common/zstream.cpp +++ b/src/common/zstream.cpp @@ -136,6 +136,7 @@ size_t wxZlibInputStream::OnSysRead(void *buffer, size_t size) // any additional data can be read from the underlying stream (the crc // in a gzip for example) if (m_inflate->avail_in) { + m_parent_i_stream->Reset(); m_parent_i_stream->Ungetch(m_inflate->next_in, m_inflate->avail_in); m_inflate->avail_in = 0; } @@ -282,7 +283,11 @@ size_t wxZlibOutputStream::OnSysWrite(const void *buffer, size_t size) wxASSERT_MSG(m_deflate && m_z_buffer, wxT("Deflate stream not open")); if (!m_deflate || !m_z_buffer) + { + // notice that this will make IsOk() test just below return false m_lasterror = wxSTREAM_WRITE_ERROR; + } + if (!IsOk() || !size) return 0;