summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2005-05-18 09:02:26 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2005-05-18 09:02:26 +0000
commit13eaf2c049cf56bf29b22d6ed68d579ae1dae08f (patch)
treef48a055d821b0416e3fc80bd1a944ea51d69dbdd /src
parent34eff91409771aae6ec7fa4c9993299f80b2fbee (diff)
downloadxine-lib-13eaf2c049cf56bf29b22d6ed68d579ae1dae08f.tar.gz
xine-lib-13eaf2c049cf56bf29b22d6ed68d579ae1dae08f.tar.bz2
**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
Diffstat (limited to 'src')
-rw-r--r--src/demuxers/demux_wav.c7
1 files changed, 6 insertions, 1 deletions
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) {