Skip to content
Permalink
Browse files

Skip JUNK chunks in wave files

  • Loading branch information
slouken committed Jul 8, 2014
1 parent 35ec007 commit 19d878d7115ba82672dd4f1c840961188f79324d
Showing with 2 additions and 1 deletion.
  1. +1 −1 src/audio/SDL_wave.c
  2. +1 −0 src/audio/SDL_wave.h
@@ -460,7 +460,7 @@ SDL_LoadWAV_RW(SDL_RWops * src, int freesrc,
}
/* 2 Uint32's for chunk header+len, plus the lenread */
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 */
format = (WaveFMT *) chunk.data;
@@ -30,6 +30,7 @@
#define FACT 0x74636166 /* "fact" */
#define LIST 0x5453494c /* "LIST" */
#define BEXT 0x74786562 /* "bext" */
#define JUNK 0x4B4E554A /* "JUNK" */
#define FMT 0x20746D66 /* "fmt " */
#define DATA 0x61746164 /* "data" */
#define PCM_CODE 0x0001

0 comments on commit 19d878d

Please sign in to comment.