diff --git a/stepmania/src/RageFile.cpp b/stepmania/src/RageFile.cpp index a7f1110136..a6669e8532 100644 --- a/stepmania/src/RageFile.cpp +++ b/stepmania/src/RageFile.cpp @@ -140,7 +140,7 @@ int RageFile::GetLine( CString &out ) /* Hack: If the last character of the buffer is \r, then it's likely that an * \r\n has been split across buffers. Move everything else, then move the * \r to the beginning of the buffer and handle it the next time around the loop. */ - if( m_pBuf[m_BufAvail-1] == '\r' ) + if( m_BufAvail && m_pBuf[m_BufAvail-1] == '\r' ) { ReAddCR = true; --m_BufAvail;