Skip JUNK chunks in wave files
authorSam Lantinga <slouken@libsdl.org>
Tue, 08 Jul 2014 00:42:14 -0700
changeset 8998995f6cd966a7
parent 8997 9e23a50a63f7
child 8999 c6398920a9ca
Skip JUNK chunks in wave files
src/audio/SDL_wave.c
src/audio/SDL_wave.h
     1.1 --- a/src/audio/SDL_wave.c	Tue Jul 08 00:23:36 2014 -0700
     1.2 +++ b/src/audio/SDL_wave.c	Tue Jul 08 00:42:14 2014 -0700
     1.3 @@ -460,7 +460,7 @@
     1.4          }
     1.5          /* 2 Uint32's for chunk header+len, plus the lenread */
     1.6          headerDiff += lenread + 2 * sizeof(Uint32);
     1.7 -    } while ((chunk.magic == FACT) || (chunk.magic == LIST) || (chunk.magic == BEXT));
     1.8 +    } while ((chunk.magic == FACT) || (chunk.magic == LIST) || (chunk.magic == BEXT) || (chunk.magic == JUNK));
     1.9  
    1.10      /* Decode the audio data format */
    1.11      format = (WaveFMT *) chunk.data;
     2.1 --- a/src/audio/SDL_wave.h	Tue Jul 08 00:23:36 2014 -0700
     2.2 +++ b/src/audio/SDL_wave.h	Tue Jul 08 00:42:14 2014 -0700
     2.3 @@ -30,6 +30,7 @@
     2.4  #define FACT            0x74636166      /* "fact" */
     2.5  #define LIST            0x5453494c      /* "LIST" */
     2.6  #define BEXT            0x74786562      /* "bext" */
     2.7 +#define JUNK            0x4B4E554A      /* "JUNK" */
     2.8  #define FMT             0x20746D66      /* "fmt " */
     2.9  #define DATA            0x61746164      /* "data" */
    2.10  #define PCM_CODE        0x0001