summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik de Castro Lopo <erikd@mega-nerd.com>2014-12-15 19:35:30 +1100
committerErik de Castro Lopo <erikd@mega-nerd.com>2014-12-16 09:36:13 +1100
commit3ea38f37bc1895cf25feaa52e5458358af01cf30 (patch)
treec6aaed9f03956059098cfc4678d2c9253275bb3b
parent77ab90d7344ea8fbcc382277c7064bf3564681f0 (diff)
src/wav.c : Handle 'smpl' chunks with loop count of 0.
Closes: https://github.com/erikd/libsndfile/issues/86
-rw-r--r--src/wav.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/wav.c b/src/wav.c
index 176ce44..a798e0c 100644
--- a/src/wav.c
+++ b/src/wav.c
@@ -1575,6 +1575,9 @@ wav_read_smpl_chunk (SF_PRIVATE *psf, uint32_t chunklen)
bytesread += psf_binheader_readf (psf, "4", &loop_count) ;
psf_log_printf (psf, " Loop Count : %u\n", loop_count) ;
+ if (loop_count == 0 && chunklen == bytesread)
+ return 0 ;
+
/* Sampler Data holds the number of data bytes after the CUE chunks which
** is not actually CUE data. Display value after CUE data.
*/