Skip to content

Commit bc6cba3

Browse files
committed
issue #67: make sure sample rate is specified and non-zero in DFF files
1 parent 33a0025 commit bc6cba3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: cli/dsdiff.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa
181181
if (!strncmp (prop_chunk, "SND ", 4)) {
182182
char *cptr = prop_chunk + 4, *eptr = prop_chunk + dff_chunk_header.ckDataSize;
183183
uint16_t numChannels = 0, chansSpecified, chanMask = 0;
184-
uint32_t sampleRate;
184+
uint32_t sampleRate = 0;
185185

186186
while (eptr - cptr >= sizeof (dff_chunk_header)) {
187187
memcpy (&dff_chunk_header, cptr, sizeof (dff_chunk_header));
@@ -280,7 +280,7 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa
280280
}
281281
else if (!strncmp (dff_chunk_header.ckID, "DSD ", 4)) {
282282

283-
if (!config->num_channels) {
283+
if (!config->num_channels || !config->sample_rate) {
284284
error_line ("%s is not a valid .DFF file!", infilename);
285285
return WAVPACK_SOFT_ERROR;
286286
}

0 commit comments

Comments
 (0)