summaryrefslogtreecommitdiff
path: root/drivers/vorbis/vorbisenc.c
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2016-06-19 18:58:22 +0200
committerGitHub <noreply@github.com>2016-06-19 18:58:22 +0200
commit7bdccc19119cec273f46d4d3b1be72f87049749a (patch)
tree396b6824fb638cb7f97f074d2975e9b3c899b08d /drivers/vorbis/vorbisenc.c
parent5cb31f6d5b667a551092b699de6f4786e0bb5b6d (diff)
parent214f316cf9c861a0083cf74b790760aab77cb2ea (diff)
Merge pull request #5292 from J08nY/external-lib-update
External lib update: libogg, libvorbis, libtheora
Diffstat (limited to 'drivers/vorbis/vorbisenc.c')
-rw-r--r--drivers/vorbis/vorbisenc.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/drivers/vorbis/vorbisenc.c b/drivers/vorbis/vorbisenc.c
index f0f7c08558..b5d621e900 100644
--- a/drivers/vorbis/vorbisenc.c
+++ b/drivers/vorbis/vorbisenc.c
@@ -5,13 +5,13 @@
* GOVERNED BY A BSD-STYLE SOURCE LICENSE INCLUDED WITH THIS SOURCE *
* IN 'COPYING'. PLEASE READ THESE TERMS BEFORE DISTRIBUTING. *
* *
- * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2009 *
+ * THE OggVorbis SOURCE CODE IS (C) COPYRIGHT 1994-2015 *
* by the Xiph.Org Foundation http://www.xiph.org/ *
* *
********************************************************************
function: simple programmatic interface for encoder mode setup
- last mod: $Id: vorbisenc.c 17028 2010-03-25 05:22:15Z xiphmont $
+ last mod: $Id: vorbisenc.c 19457 2015-03-03 00:15:29Z giles $
********************************************************************/
@@ -903,8 +903,12 @@ int vorbis_encode_setup_vbr(vorbis_info *vi,
long channels,
long rate,
float quality){
- codec_setup_info *ci=vi->codec_setup;
- highlevel_encode_setup *hi=&ci->hi;
+ codec_setup_info *ci;
+ highlevel_encode_setup *hi;
+ if(rate<=0) return OV_EINVAL;
+
+ ci=vi->codec_setup;
+ hi=&ci->hi;
quality+=.0000001;
if(quality>=1.)quality=.9999;
@@ -948,9 +952,14 @@ int vorbis_encode_setup_managed(vorbis_info *vi,
long nominal_bitrate,
long min_bitrate){
- codec_setup_info *ci=vi->codec_setup;
- highlevel_encode_setup *hi=&ci->hi;
- double tnominal=nominal_bitrate;
+ codec_setup_info *ci;
+ highlevel_encode_setup *hi;
+ double tnominal;
+ if(rate<=0) return OV_EINVAL;
+
+ ci=vi->codec_setup;
+ hi=&ci->hi;
+ tnominal=nominal_bitrate;
if(nominal_bitrate<=0.){
if(max_bitrate>0.){