Mercurial > SDL_sound_CoreAudio
comparison decoders/speex.c @ 528:61a317171ef0 stable-1.0
Merge r536:537 from trunk: Speex bogus data check.
author | Ryan C. Gordon <icculus@icculus.org> |
---|---|
date | Fri, 11 Apr 2008 19:55:10 +0000 |
parents | 50bb9a6cebfe |
children | a8492d97dd5a |
comparison
equal
deleted
inserted
replaced
525:50bb9a6cebfe | 528:61a317171ef0 |
---|---|
134 BAIL_IF_MACRO(!hptr, "SPEEX: Cannot read header", 0); | 134 BAIL_IF_MACRO(!hptr, "SPEEX: Cannot read header", 0); |
135 memcpy(&header, hptr, sizeof (SpeexHeader)); /* move to stack. */ | 135 memcpy(&header, hptr, sizeof (SpeexHeader)); /* move to stack. */ |
136 free(hptr); /* lame that this forces you to malloc... */ | 136 free(hptr); /* lame that this forces you to malloc... */ |
137 | 137 |
138 BAIL_IF_MACRO(header.mode >= SPEEX_NB_MODES, "SPEEX: Unknown mode", 0); | 138 BAIL_IF_MACRO(header.mode >= SPEEX_NB_MODES, "SPEEX: Unknown mode", 0); |
139 BAIL_IF_MACRO(header.mode < 0, "SPEEX: Unknown mode", 0); | |
139 mode = speex_mode_list[header.mode]; | 140 mode = speex_mode_list[header.mode]; |
140 BAIL_IF_MACRO(header.speex_version_id > 1, "SPEEX: Unknown version", 0); | 141 BAIL_IF_MACRO(header.speex_version_id > 1, "SPEEX: Unknown version", 0); |
141 BAIL_IF_MACRO(mode->bitstream_version < header.mode_bitstream_version, | 142 BAIL_IF_MACRO(mode->bitstream_version < header.mode_bitstream_version, |
142 "SPEEX: Unsupported bitstream version", 0); | 143 "SPEEX: Unsupported bitstream version", 0); |
143 BAIL_IF_MACRO(mode->bitstream_version > header.mode_bitstream_version, | 144 BAIL_IF_MACRO(mode->bitstream_version > header.mode_bitstream_version, |