Corrected a couple problems in wxStreamBuffer that show up when
reading from a wxMemoryStream git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17977 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
|
||||
void wxStreamBuffer::SetError(wxStreamError err)
|
||||
{
|
||||
if ( m_stream->m_lasterror == wxSTREAM_NO_ERROR )
|
||||
if ( m_stream && m_stream->m_lasterror == wxSTREAM_NO_ERROR )
|
||||
m_stream->m_lasterror = err;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,9 @@ bool wxStreamBuffer::FillBuffer()
|
||||
{
|
||||
wxInputStream *inStream = GetInputStream();
|
||||
|
||||
wxCHECK_MSG( inStream, FALSE, _T("should have a stream in wxStreamBuffer") );
|
||||
// It's legal to have no stream, so we shouldn't don't about it just return FALSE
|
||||
if ( !inStream )
|
||||
return FALSE;
|
||||
|
||||
size_t count = inStream->OnSysRead(m_buffer_start, m_buffer_size);
|
||||
if ( !count )
|
||||
|
Reference in New Issue
Block a user