From 0aaf1692f22bdc9b02832e84ffab4b65b0ec6f8f Mon Sep 17 00:00:00 2001 From: Tristan Matthews Date: Tue, 11 Sep 2018 05:12:53 -0400 Subject: [PATCH] wav_io: check for EOF when seeking in wav Fixes hang discovered by fuzzing: https://github.com/xiph/speex/issues/9 --- src/wav_io.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/wav_io.c b/src/wav_io.c index c2e2bc85..4754b2ff 100644 --- a/src/wav_io.c +++ b/src/wav_io.c @@ -75,8 +75,11 @@ int read_wav_header(FILE *file, int *rate, int *channels, int *format, spx_int32 itmp = le_int(itmp); /*fprintf (stderr, "skip=%d\n", itmp);*/ /*strange way of seeking, but it works even for pipes*/ - for (i=0;i0) - for (i=0;i0) { + for (i=0;i