early-access version 1617
This commit is contained in:
13
externals/SDL/src/audio/SDL_wave.c
vendored
13
externals/SDL/src/audio/SDL_wave.c
vendored
@@ -22,19 +22,17 @@
|
||||
|
||||
#ifdef HAVE_LIMITS_H
|
||||
#include <limits.h>
|
||||
#else
|
||||
#ifndef SIZE_MAX
|
||||
#define SIZE_MAX ((size_t)-1)
|
||||
#endif
|
||||
#ifndef INT_MAX
|
||||
/* Make a lucky guess. */
|
||||
#define INT_MAX SDL_MAX_SINT32
|
||||
#endif
|
||||
#ifndef SIZE_MAX
|
||||
#define SIZE_MAX ((size_t)-1)
|
||||
#endif
|
||||
|
||||
/* Microsoft WAVE file loading routines */
|
||||
|
||||
#include "SDL_log.h"
|
||||
#include "SDL_hints.h"
|
||||
#include "SDL_audio.h"
|
||||
#include "SDL_wave.h"
|
||||
@@ -929,7 +927,7 @@ IMA_ADPCM_DecodeBlockHeader(ADPCM_DecoderState *state)
|
||||
{
|
||||
Sint16 step;
|
||||
Uint32 c;
|
||||
Uint8 *cstate = state->cstate;
|
||||
Uint8 *cstate = (Uint8 *) state->cstate;
|
||||
|
||||
for (c = 0; c < state->channels; c++) {
|
||||
size_t o = state->block.pos + c * 4;
|
||||
@@ -1335,7 +1333,8 @@ PCM_Init(WaveFile *file, size_t datalength)
|
||||
/* It wouldn't be that hard to support more exotic block sizes, but
|
||||
* the most common formats should do for now.
|
||||
*/
|
||||
if (format->blockalign * 8 != format->channels * format->bitspersample) {
|
||||
/* Make sure we're a multiple of the blockalign, at least. */
|
||||
if ((format->channels * format->bitspersample) % (format->blockalign * 8)) {
|
||||
return SDL_SetError("Unsupported block alignment");
|
||||
}
|
||||
|
||||
@@ -1561,7 +1560,7 @@ WaveReadPartialChunkData(SDL_RWops *src, WaveChunk *chunk, size_t length)
|
||||
}
|
||||
|
||||
if (length > 0) {
|
||||
chunk->data = SDL_malloc(length);
|
||||
chunk->data = (Uint8 *) SDL_malloc(length);
|
||||
if (chunk->data == NULL) {
|
||||
return SDL_OutOfMemory();
|
||||
}
|
||||
|
Reference in New Issue
Block a user