mirror of
https://github.com/UberGames/ioef.git
synced 2024-12-01 00:21:19 +00:00
* Fix to half of bug #2600 (Refuse to load RIFF files with less than 8 bits per
sample)
This commit is contained in:
parent
6fd0d60628
commit
cb1a097db7
1 changed files with 10 additions and 1 deletions
|
@ -132,6 +132,7 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
|
||||||
{
|
{
|
||||||
char dump[16];
|
char dump[16];
|
||||||
int wav_format;
|
int wav_format;
|
||||||
|
int bits;
|
||||||
int fmtlen = 0;
|
int fmtlen = 0;
|
||||||
|
|
||||||
// skip the riff wav header
|
// skip the riff wav header
|
||||||
|
@ -150,7 +151,15 @@ static qboolean S_ReadRIFFHeader(fileHandle_t file, snd_info_t *info)
|
||||||
info->rate = FGetLittleLong(file);
|
info->rate = FGetLittleLong(file);
|
||||||
FGetLittleLong(file);
|
FGetLittleLong(file);
|
||||||
FGetLittleShort(file);
|
FGetLittleShort(file);
|
||||||
info->width = FGetLittleShort(file) / 8;
|
bits = FGetLittleShort(file);
|
||||||
|
|
||||||
|
if( bits < 8 )
|
||||||
|
{
|
||||||
|
Com_Printf( S_COLOR_RED "ERROR: Less than 8 bit sound is not supported\n");
|
||||||
|
return qfalse;
|
||||||
|
}
|
||||||
|
|
||||||
|
info->width = bits / 8;
|
||||||
info->dataofs = 0;
|
info->dataofs = 0;
|
||||||
|
|
||||||
// Skip the rest of the format chunk if required
|
// Skip the rest of the format chunk if required
|
||||||
|
|
Loading…
Reference in a new issue