Add debugging asserts for a divide by zero bug report.

This commit is contained in:
Steve Checkoway
2009-09-14 07:59:14 +00:00
parent 5d7ce555b6
commit b60a92e633
+2
View File
@@ -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 /* We can speed up the seek using the XING tag. First, figure
* out what percentage the requested position falls in. */ * out what percentage the requested position falls in. */
ASSERT( SampleRate != 0 );
int ms = int( (iFrame * 1000LL) / SampleRate ); int ms = int( (iFrame * 1000LL) / SampleRate );
ASSERT( mad->length != 0 );
int percent = ms * 100 / mad->length; int percent = ms * 100 / mad->length;
if( percent < 100 ) if( percent < 100 )
{ {