fix crashes when files fail to open

This commit is contained in:
Glenn Maynard
2003-10-12 03:01:07 +00:00
parent 712289aa29
commit d3755f98a5
4 changed files with 17 additions and 2 deletions
+5
View File
@@ -511,6 +511,11 @@ SoundReader_FileReader::OpenResult RageSoundReader_WAV::Open( CString filename_
Input_Buffer_Ratio = 1;
filename = filename_;
rw = fopen(filename, "rb");
if( !rw )
{
SetError( ssprintf("Couldn't open file: %s", strerror(errno)) );
return OPEN_NO_MATCH;
}
memset(&fmt, 0, sizeof(fmt));