summaryrefslogtreecommitdiff
path: root/indra/llaudio/llaudiodecodemgr.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2010-08-10 16:11:33 +0300
committerVadim Savchuk <vsavchuk@productengine.com>2010-08-10 16:11:33 +0300
commit9d6fd1c63ff66e696a6e4207daf169c1d4106e7e (patch)
tree3d188109310089012f5bd5bbf40202c05ca897aa /indra/llaudio/llaudiodecodemgr.cpp
parentfcc19791b3ffc1e65de77c20d7fa441bf3c4f1ad (diff)
parentf2fd3b8a2f0d14d91b419d68b5214c78f01bd3c7 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/llaudio/llaudiodecodemgr.cpp')
-rw-r--r--indra/llaudio/llaudiodecodemgr.cpp24
1 files changed, 19 insertions, 5 deletions
diff --git a/indra/llaudio/llaudiodecodemgr.cpp b/indra/llaudio/llaudiodecodemgr.cpp
index 290206ee22..fc2190707a 100644
--- a/indra/llaudio/llaudiodecodemgr.cpp
+++ b/indra/llaudio/llaudiodecodemgr.cpp
@@ -230,19 +230,29 @@ BOOL LLVorbisDecodeState::initDecode()
bool abort_decode = false;
- if( vi->channels < 1 || vi->channels > LLVORBIS_CLIP_MAX_CHANNELS )
+ if (vi)
+ {
+ if( vi->channels < 1 || vi->channels > LLVORBIS_CLIP_MAX_CHANNELS )
+ {
+ abort_decode = true;
+ llwarns << "Bad channel count: " << vi->channels << llendl;
+ }
+ }
+ else // !vi
{
abort_decode = true;
- llwarns << "Bad channel count: " << vi->channels << llendl;
+ llwarns << "No default bitstream found" << llendl;
}
- if( (size_t)sample_count > LLVORBIS_CLIP_REJECT_SAMPLES )
+ if( (size_t)sample_count > LLVORBIS_CLIP_REJECT_SAMPLES ||
+ (size_t)sample_count <= 0)
{
abort_decode = true;
llwarns << "Illegal sample count: " << sample_count << llendl;
}
- if( size_guess > LLVORBIS_CLIP_REJECT_SIZE )
+ if( size_guess > LLVORBIS_CLIP_REJECT_SIZE ||
+ size_guess < 0)
{
abort_decode = true;
llwarns << "Illegal sample size: " << size_guess << llendl;
@@ -251,7 +261,11 @@ BOOL LLVorbisDecodeState::initDecode()
if( abort_decode )
{
llwarns << "Canceling initDecode. Bad asset: " << mUUID << llendl;
- llwarns << "Bad asset encoded by: " << ov_comment(&mVF,-1)->vendor << llendl;
+ vorbis_comment* comment = ov_comment(&mVF,-1);
+ if (comment && comment->vendor)
+ {
+ llwarns << "Bad asset encoded by: " << comment->vendor << llendl;
+ }
delete mInFilep;
mInFilep = NULL;
return FALSE;