Skip to content

Commit

Permalink
Skip JUNK chunks in wave files
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 8, 2014
1 parent 5e739f3 commit 3429efc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wavestream.c
Expand Up @@ -50,6 +50,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 1
Expand Down Expand Up @@ -305,7 +306,7 @@ static SDL_RWops *LoadWAVStream (SDL_RWops *src, SDL_AudioSpec *spec,
was_error = 1;
goto done;
}
} 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;
Expand Down

0 comments on commit 3429efc

Please sign in to comment.