Fix encoder crash with non-positive sample rates.
authorRalph Giles <giles@xiph.org>
Mon, 5 Jan 2015 18:04:20 +0000 (18:04 +0000)
committerRalph Giles <giles@xiph.org>
Mon, 5 Jan 2015 18:04:20 +0000 (18:04 +0000)
commit8d5416c77e1aaa93b85a9e71d90531f9fb67aebc
treea57cc0e2c0ee7561d8c6cc6ea830d19f80e96a03
parent752f0cb5dc22dc7f5ce69c911265ad46cd5502d6
Fix encoder crash with non-positive sample rates.

Input files with sampling rate 0 are useless and can make
libvorbis access invalid memory because the logic in
_vp_psy_init (and probably other functions) isn't prepared for
it. A sanity check lets the library refuse those inputs
gracefully in the initialization functions before they can
do harm.

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

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

svn path=/trunk/vorbis/; revision=19422
lib/vorbisenc.c