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
long channels,
long rate,
float quality){
+ if(rate <= 0) return OV_EINVAL;
+
codec_setup_info *ci=vi->codec_setup;
highlevel_encode_setup *hi=&ci->hi;
long nominal_bitrate,
long min_bitrate){
+ if(rate <= 0) return OV_EINVAL;
+
codec_setup_info *ci=vi->codec_setup;
highlevel_encode_setup *hi=&ci->hi;
double tnominal=nominal_bitrate;