Blame SOURCES/wavpack-0007-issue-53-error-out-on-zero-sample-rate.patch

6c343d
diff --git a/src/pack_utils.c b/src/pack_utils.c
6c343d
index 2253f0d..2a83497 100644
6c343d
--- a/src/pack_utils.c
6c343d
+++ b/src/pack_utils.c
6c343d
@@ -195,6 +195,11 @@ int WavpackSetConfiguration64 (WavpackContext *wpc, WavpackConfig *config, int64
6c343d
     int num_chans = config->num_channels;
6c343d
     int i;
6c343d
 
6c343d
+    if (!config->sample_rate) {
6c343d
+        strcpy (wpc->error_message, "sample rate cannot be zero!");
6c343d
+        return FALSE;
6c343d
+    }
6c343d
+
6c343d
     wpc->stream_version = (config->flags & CONFIG_COMPATIBLE_WRITE) ? CUR_STREAM_VERS : MAX_STREAM_VERS;
6c343d
 
6c343d
     if ((config->qmode & QMODE_DSD_AUDIO) && config->bytes_per_sample == 1 && config->bits_per_sample == 8) {