From 6772c9b6898e22ba794b5779598abaf2d0aa7b41 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Fri, 25 Jun 2004 19:09:44 +0000 Subject: [PATCH] fix possible underrun --- stepmania/src/RageFile.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;