aboutsummaryrefslogtreecommitdiffstats
path: root/main/wavpack/CVE-2019-1010315.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/wavpack/CVE-2019-1010315.patch')
-rw-r--r--main/wavpack/CVE-2019-1010315.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/wavpack/CVE-2019-1010315.patch b/main/wavpack/CVE-2019-1010315.patch
new file mode 100644
index 00000000000..b52d8884a00
--- /dev/null
+++ b/main/wavpack/CVE-2019-1010315.patch
@@ -0,0 +1,36 @@
+From 4c0faba32fddbd0745cbfaf1e1aeb3da5d35b9fc Mon Sep 17 00:00:00 2001
+From: David Bryant <david@wavpack.com>
+Date: Sat, 2 Mar 2019 18:37:14 -0800
+Subject: [PATCH] issue #65: make sure DSDIFF files have a valid channel count
+
+---
+ cli/dsdiff.c | 10 ++++++++--
+ 1 file changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/cli/dsdiff.c b/cli/dsdiff.c
+index 0ac4321..f357181 100644
+--- a/cli/dsdiff.c
++++ b/cli/dsdiff.c
+@@ -180,7 +180,7 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa
+
+ if (!strncmp (prop_chunk, "SND ", 4)) {
+ char *cptr = prop_chunk + 4, *eptr = prop_chunk + dff_chunk_header.ckDataSize;
+- uint16_t numChannels, chansSpecified, chanMask = 0;
++ uint16_t numChannels = 0, chansSpecified, chanMask = 0;
+ uint32_t sampleRate;
+
+ while (eptr - cptr >= sizeof (dff_chunk_header)) {
+@@ -279,6 +279,12 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa
+ free (prop_chunk);
+ }
+ else if (!strncmp (dff_chunk_header.ckID, "DSD ", 4)) {
++
++ if (!config->num_channels) {
++ error_line ("%s is not a valid .DFF file!", infilename);
++ return WAVPACK_SOFT_ERROR;
++ }
++
+ total_samples = dff_chunk_header.ckDataSize / config->num_channels;
+ break;
+ }
+