Skip to content

Commit 070ef6f

Browse files
committed
issue #53: error out on zero sample rate
1 parent e731cea commit 070ef6f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: src/pack_utils.c

+5
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,11 @@ int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64
195195
int num_chans = config->num_channels;
196196
int i;
197197

198+
if (!config->sample_rate) {
199+
strcpy (wpc->error_message, "sample rate cannot be zero!");
200+
return FALSE;
201+
}
202+
198203
wpc->stream_version = (config->flags & CONFIG_COMPATIBLE_WRITE) ? CUR_STREAM_VERS : MAX_STREAM_VERS;
199204

200205
if ((config->qmode & QMODE_DSD_AUDIO) && config->bytes_per_sample == 1 && config->bits_per_sample == 8) {

0 commit comments

Comments
 (0)