diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-09-23 19:30:54 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2012-09-23 19:30:54 +0000 |
| commit | e81974f7ecc531f43d42180985b9cb37ffb96934 (patch) | |
| tree | 6ab43adaebd01ae091df2f60bf2bb26ccbf2e092 /libpcsxcore/cdrom.c | |
| parent | bda521f3a4c42277160381ddfbfb8e42b7e87274 (diff) | |
| download | pcsxr-e81974f7ecc531f43d42180985b9cb37ffb96934.tar.gz | |
Fixing some unitialized variables caught by Clang. Also fixing a divide by zero error
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@79981 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'libpcsxcore/cdrom.c')
| -rw-r--r-- | libpcsxcore/cdrom.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libpcsxcore/cdrom.c b/libpcsxcore/cdrom.c index 84ec5d15..405f2a88 100644 --- a/libpcsxcore/cdrom.c +++ b/libpcsxcore/cdrom.c @@ -223,13 +223,21 @@ void adjustTransferIndex() unsigned int bufSize = 0;
switch (cdr.Mode & (MODE_SIZE_2340|MODE_SIZE_2328)) {
+ //Do we need a default case in this switch?
case MODE_SIZE_2340: bufSize = 2340; break;
case MODE_SIZE_2328: bufSize = 12 + 2328; break;
case MODE_SIZE_2048: bufSize = 12 + 2048; break;
}
if (cdr.transferIndex >= bufSize)
- cdr.transferIndex %= bufSize;
+ {
+ if (bufSize == 0) {
+ //Make sure we don't divide by zero
+ //Do nothing
+ } else {
+ cdr.transferIndex %= bufSize;
+ }
+ }
}
void cdrDecodedBufferInterrupt()
@@ -518,7 +526,7 @@ static void ReadTrack( u8 *time ) { static void CDXA_Attenuation( s16 *buf, int size, int stereo, int attenuate_type )
{
s16 *spsound;
- s32 lc = 0,rc;
+ s32 lc = 0, rc = 0;
int i;
spsound = buf;
|
