From b60a92e63337788f716cadac97cb09ba3bf1aca7 Mon Sep 17 00:00:00 2001 From: Steve Checkoway Date: Mon, 14 Sep 2009 07:59:14 +0000 Subject: [PATCH] Add debugging asserts for a divide by zero bug report. --- stepmania/src/RageSoundReader_MP3.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/stepmania/src/RageSoundReader_MP3.cpp b/stepmania/src/RageSoundReader_MP3.cpp index 61b9b9d18d..f275d273a2 100644 --- a/stepmania/src/RageSoundReader_MP3.cpp +++ b/stepmania/src/RageSoundReader_MP3.cpp @@ -804,7 +804,9 @@ int RageSoundReader_MP3::SetPosition_toc( int iFrame, bool Xing ) { /* We can speed up the seek using the XING tag. First, figure * out what percentage the requested position falls in. */ + ASSERT( SampleRate != 0 ); int ms = int( (iFrame * 1000LL) / SampleRate ); + ASSERT( mad->length != 0 ); int percent = ms * 100 / mad->length; if( percent < 100 ) {