summaryrefslogtreecommitdiff
path: root/src/w64.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w64.c')
-rw-r--r--src/w64.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/w64.c b/src/w64.c
index 09afbfb..c05225d 100644
--- a/src/w64.c
+++ b/src/w64.c
@@ -375,6 +375,12 @@ w64_read_header (SF_PRIVATE *psf, int *blockalign, int *framesperblock)
if (psf->dataoffset <= 0)
return SFE_W64_NO_DATA ;
+ if (psf->sf.channels < 1)
+ return SFE_CHANNEL_COUNT_ZERO ;
+
+ if (psf->sf.channels >= SF_MAX_CHANNELS)
+ return SFE_CHANNEL_COUNT ;
+
psf->endian = SF_ENDIAN_LITTLE ; /* All W64 files are little endian. */
if (psf_ftell (psf) != psf->dataoffset)