[Scummvm-cvs-logs] CVS: scummvm/sound voc.cpp,1.12,1.13
Max Horn
fingolfin at users.sourceforge.net
Tue Feb 3 00:56:13 CET 2004
Update of /cvsroot/scummvm/scummvm/sound
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15070/sound
Modified Files:
voc.cpp
Log Message:
Act more gracefully when failing to load a (VOC) sound (should help bug #889442)
Index: voc.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sound/voc.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- voc.cpp 6 Jan 2004 12:45:33 -0000 1.12
+++ voc.cpp 3 Feb 2004 08:53:13 -0000 1.13
@@ -156,6 +156,9 @@
int size, rate, loops;
byte *data = readVOCFromMemory(ptr, size, rate, loops);
+ if (!data)
+ return 0;
+
return makeLinearInputStream(rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, data, size, 0, 0);
}
@@ -163,6 +166,9 @@
int size, rate;
byte *data = loadVOCFile(file, size, rate);
+ if (!data)
+ return 0;
+
return makeLinearInputStream(rate, SoundMixer::FLAG_AUTOFREE | SoundMixer::FLAG_UNSIGNED, data, size, 0, 0);
}
More information about the Scummvm-git-logs
mailing list