1 From: =?utf-8?q?Martin_Stegh=C3=B6fer?= <martin@steghoefer.eu>
2 Date: Mon, 27 Oct 2014 19:51:13 +0100
3 Subject: Add sampling rate sanity check to avoid crash.
5 Bug-Debian: https://bugs.debian.org/716613
6 Forwarded: https://trac.xiph.org/ticket/2078
8 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.
10 oggenc/oggenc.c | 9 +++++++++
11 1 file changed, 9 insertions(+)
13 diff --git a/oggenc/oggenc.c b/oggenc/oggenc.c
14 index 5c36fea..6a6d8fe 100644
17 @@ -272,6 +272,15 @@ int main(int argc, char **argv)
22 + if(enc_opts.rate <= 0)
24 + fprintf(stderr, _("ERROR: Input file \"%s\" has invalid sampling rate\n"), infiles[i]?infiles[i]:"(stdin)");
31 /* Ok. We can read the file - so now open the output file */