summaryrefslogtreecommitdiff
path: root/audio/libsndfile/patches/patch-ac
diff options
context:
space:
mode:
Diffstat (limited to 'audio/libsndfile/patches/patch-ac')
-rw-r--r--audio/libsndfile/patches/patch-ac29
1 files changed, 29 insertions, 0 deletions
diff --git a/audio/libsndfile/patches/patch-ac b/audio/libsndfile/patches/patch-ac
new file mode 100644
index 00000000000..c30d55ef48f
--- /dev/null
+++ b/audio/libsndfile/patches/patch-ac
@@ -0,0 +1,29 @@
+$NetBSD: patch-ac,v 1.11.2.2 2009/06/08 21:05:22 spz Exp $
+
+Upstream fix for DoS vulnerability taken from here:
+
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530831
+
+--- src/htk.c.orig 2009-03-22 19:17:14.000000000 +0000
++++ src/htk.c 2009-06-08 10:03:02.000000000 +0100
+@@ -195,10 +195,17 @@
+ return SFE_HTK_NOT_WAVEFORM ;
+
+ psf->sf.channels = 1 ;
+- psf->sf.samplerate = 10000000 / sample_period ;
+
+- psf_log_printf (psf, "HTK Waveform file\n Sample Count : %d\n Sample Period : %d => %d Hz\n",
+- sample_count, sample_period, psf->sf.samplerate) ;
++ if (sample_period > 0)
++ { psf->sf.samplerate = 10000000 / sample_period ;
++ psf_log_printf (psf, "HTK Waveform file\n Sample Count : %d\n Sample Period : %d => %d Hz\n",
++ sample_count, sample_period, psf->sf.samplerate) ;
++ }
++ else
++ { psf->sf.samplerate = 16000 ;
++ psf_log_printf (psf, "HTK Waveform file\n Sample Count : %d\n Sample Period : %d (should be > 0) => Guessed sample rate %d Hz\n",
++ sample_count, sample_period, psf->sf.samplerate) ;
++ } ;
+
+ psf->sf.format = SF_FORMAT_HTK | SF_FORMAT_PCM_16 ;
+ psf->bytewidth = 2 ;