Fixed: Possible use after free and null pointer issues

--HG--
branch : develop
feature/pipeline-tools
Nimetu 6 years ago
parent 1635330a14
commit 70e40339a1

@ -91,9 +91,12 @@ CAudioDecoderMP3::CAudioDecoderMP3(NLMISC::IStream *stream, bool loop)
}
CAudioDecoderMP3::~CAudioDecoderMP3()
{
if (_IsSupported)
{
drmp3_uninit(&_Decoder);
}
}
bool CAudioDecoderMP3::isFormatSupported() const
{

@ -704,7 +704,9 @@ void CComplexSource::checkup()
for (; first != last; ++first)
{
USource *source = *first;
if (source != NULL && source->getSound()->getLooping() && !source->isPlaying())
if (source == NULL)
continue;
if (source->getSound()->getLooping() && !source->isPlaying())
source->play();
if (source->getSound()->getSoundType() != CSound::SOUND_SIMPLE)
static_cast<CSourceCommon*>(source)->checkup();

@ -194,6 +194,10 @@ uint CSourceAL::countStreamingBuffers() const
// a bit ugly here, but makes a much easier/simpler implementation on both drivers
ALint buffersProcessed;
alGetSourcei(_Source, AL_BUFFERS_PROCESSED, &buffersProcessed);
if (buffersProcessed && _QueuedBuffers.empty())
{
nlwarning("AL: QueuedBuffers is empty, but OpenAL buffers processed > 0");
}
while (buffersProcessed && !_QueuedBuffers.empty())
{
ALuint bufferName = _QueuedBuffers.front()->bufferName();

@ -82,15 +82,16 @@ void CSampleBankManager::init(NLGEORGES::UFormElm *mixerConfig)
TFilteredBank fb;
std::string bankName;
NLGEORGES::UFormElm *realBank = NULL;
realBank->getArrayNode(&realBank, j);
realBanks->getArrayNode(&realBank, j);
if (realBank != 0)
{
realBank->getValueByName(bankName, ".SampleBank");
fb.BankName = CStringMapper::map(bankName);
realBank->getValueByName(fb.Filter, ".Filter");
vfb.push_back(fb);
}
}
}
if (!vfb.empty())
{

@ -92,7 +92,7 @@ void CStreamSource::releasePhysicalSource()
// free the track
pSource->stop();
pSource->setStreaming(false);
mixer->freeTrack(m_Track);
if (mixer) mixer->freeTrack(m_Track);
m_Track = NULL;
}
}

Loading…
Cancel
Save