[vorbis-tools] 02/02: Add sampling rate sanity check to avoid crash.
Martin Steghöfer
martin.steghoefer-guest at moszumanska.debian.org
Mon Oct 27 18:57:36 UTC 2014
This is an automated email from the git hooks/post-receive script.
martin.steghoefer-guest pushed a commit to branch master
in repository vorbis-tools.
commit dcebb9a81496d8d99455bc6d37ae8d230e96bc59
Author: Martin Steghöfer <martin at steghoefer.eu>
Date: Mon Oct 27 19:52:23 2014 +0100
Add sampling rate sanity check to avoid crash.
---
...sampling-rate-sanity-check-to-avoid-crash.patch | 31 ++++++++++++++++++++++
debian/patches/series | 1 +
2 files changed, 32 insertions(+)
diff --git a/debian/patches/0006-Add-sampling-rate-sanity-check-to-avoid-crash.patch b/debian/patches/0006-Add-sampling-rate-sanity-check-to-avoid-crash.patch
new file mode 100644
index 0000000..227741d
--- /dev/null
+++ b/debian/patches/0006-Add-sampling-rate-sanity-check-to-avoid-crash.patch
@@ -0,0 +1,31 @@
+From: =?utf-8?q?Martin_Stegh=C3=B6fer?= <martin at steghoefer.eu>
+Date: Mon, 27 Oct 2014 19:51:13 +0100
+Subject: Add sampling rate sanity check to avoid crash.
+
+Bug-Debian: https://bugs.debian.org/716613
+
+Input files with sampling rate 0 are useless and can make oggenc crash because neither oggenc itself nor libvorbis are prepared for this case. A sanity check lets the program refuse those inputs gracefully without crash.
+---
+ oggenc/oggenc.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/oggenc/oggenc.c b/oggenc/oggenc.c
+index 5c36fea..6a6d8fe 100644
+--- a/oggenc/oggenc.c
++++ b/oggenc/oggenc.c
+@@ -272,6 +272,15 @@ int main(int argc, char **argv)
+ errors++;
+ continue;
+ }
++
++ if(enc_opts.rate <= 0)
++ {
++ fprintf(stderr, _("ERROR: Input file \"%s\" has invalid sampling rate\n"), infiles[i]?infiles[i]:"(stdin)");
++ if(closein)
++ fclose(in);
++ errors++;
++ continue;
++ }
+
+ /* Ok. We can read the file - so now open the output file */
+
diff --git a/debian/patches/series b/debian/patches/series
index 603dc21..754ad6a 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
0003-Floating-point-comparison-fails.patch
0004-Fix-format-error-blocking-compilation-with-hardening.patch
0005-Fix-URL-in-manpage.patch
+0006-Add-sampling-rate-sanity-check-to-avoid-crash.patch
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-xiph/vorbis-tools.git
More information about the pkg-xiph-commits
mailing list