mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-20 07:58:44 +00:00
Fixed: Possible crashes if ov_info returns NULL
--HG-- branch : develop
This commit is contained in:
parent
a77fee685b
commit
962b43d2bd
1 changed files with 6 additions and 2 deletions
|
@ -195,13 +195,17 @@ uint32 CAudioDecoderVorbis::getNextBytes(uint8 *buffer, uint32 minimum, uint32 m
|
|||
uint8 CAudioDecoderVorbis::getChannels()
|
||||
{
|
||||
vorbis_info *vi = ov_info(&_OggVorbisFile, -1);
|
||||
return (uint8)vi->channels;
|
||||
if (vi) return (uint8)vi->channels;
|
||||
nlwarning("ov_info returned NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint CAudioDecoderVorbis::getSamplesPerSec()
|
||||
{
|
||||
vorbis_info *vi = ov_info(&_OggVorbisFile, -1);
|
||||
return (uint)vi->rate;
|
||||
if (vi) return (uint)vi->rate;
|
||||
nlwarning("ov_info returned NULL");
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint8 CAudioDecoderVorbis::getBitsPerSample()
|
||||
|
|
Loading…
Reference in a new issue