Commit 29e11cac authored by Ralph Giles's avatar Ralph Giles

oggenc: Reject files with non-positive sample rates.

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.

Patch by Martin Steghöfer <martin@steghoefer.eu>

Fixes #2078
Bug-Debian: https://bugs.debian.org/716613

svn path=/trunk/vorbis-tools/; revision=19423
parent 422daa25
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment