From 13eaf2c049cf56bf29b22d6ed68d579ae1dae08f Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Wed, 18 May 2005 09:02:26 +0000 Subject: **BUGFIX** Avoid silly errors and engine state when trying to read a file with '0' channels (See http://bugzilla.gnome.org/show_bug.cgi?id=304588 for test file) CVS patchset: 7550 CVS date: 2005/05/18 09:02:26 --- src/demuxers/demux_wav.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/demuxers/demux_wav.c b/src/demuxers/demux_wav.c index f20f326d4..eaa4fb9d8 100644 --- a/src/demuxers/demux_wav.c +++ b/src/demuxers/demux_wav.c @@ -22,7 +22,7 @@ * MS WAV File Demuxer by Mike Melanson (melanson@pcisys.net) * based on WAV specs that are available far and wide * - * $Id: demux_wav.c,v 1.60 2004/06/14 19:15:36 hadess Exp $ + * $Id: demux_wav.c,v 1.61 2005/05/18 09:02:26 hadess Exp $ */ #ifdef HAVE_CONFIG_H @@ -121,6 +121,11 @@ static int open_wav_file(demux_wav_t *this) { this->audio_type = BUF_AUDIO_UNKNOWN; } + if (this->wave->nChannels <= 0) { + free (this->wave); + return 0; + } + /* traverse through the chunks to find the 'data' chunk */ this->data_start = this->data_size = 0; while (this->data_start == 0) { -- cgit v1.2.3