Skip to content
Permalink
Browse files Browse the repository at this point in the history
issue #53: error out on zero sample rate
  • Loading branch information
dbry committed Nov 30, 2018
1 parent e731cea commit 070ef6f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/pack_utils.c
Expand Up @@ -195,6 +195,11 @@ int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64
int num_chans = config->num_channels;
int i;

if (!config->sample_rate) {
strcpy (wpc->error_message, "sample rate cannot be zero!");
return FALSE;
}

wpc->stream_version = (config->flags & CONFIG_COMPATIBLE_WRITE) ? CUR_STREAM_VERS : MAX_STREAM_VERS;

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

0 comments on commit 070ef6f

Please sign in to comment.