Skip JUNK chunks in wave files

main
Sam Lantinga 2014-07-08 00:42:14 -07:00
parent 35ec0075cf
commit 19d878d711
2 changed files with 2 additions and 1 deletions

View File

@ -460,7 +460,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
} }
/* 2 Uint32's for chunk header+len, plus the lenread */ /* 2 Uint32's for chunk header+len, plus the lenread */
headerDiff += lenread + 2 * sizeof(Uint32); headerDiff += lenread + 2 * sizeof(Uint32);
} while ((chunk.magic == FACT) || (chunk.magic == LIST) || (chunk.magic == BEXT)); } while ((chunk.magic == FACT) || (chunk.magic == LIST) || (chunk.magic == BEXT) || (chunk.magic == JUNK));
/* Decode the audio data format */ /* Decode the audio data format */
format = (WaveFMT *) chunk.data; format = (WaveFMT *) chunk.data;

View File

@ -30,6 +30,7 @@
#define FACT 0x74636166 /* "fact" */ #define FACT 0x74636166 /* "fact" */
#define LIST 0x5453494c /* "LIST" */ #define LIST 0x5453494c /* "LIST" */
#define BEXT 0x74786562 /* "bext" */ #define BEXT 0x74786562 /* "bext" */
#define JUNK 0x4B4E554A /* "JUNK" */
#define FMT 0x20746D66 /* "fmt " */ #define FMT 0x20746D66 /* "fmt " */
#define DATA 0x61746164 /* "data" */ #define DATA 0x61746164 /* "data" */
#define PCM_CODE 0x0001 #define PCM_CODE 0x0001