diff options
author | Chris Robinson <[email protected]> | 2014-05-14 03:40:01 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2014-05-14 03:40:01 -0700 |
commit | debd5346fbd57cf713d722b055cee916cbc432ba (patch) | |
tree | 3d772ba6cf0b45aacf1cefdc1019cd979861d180 | |
parent | f311f74001a30b3d1f518764a4dce2b9333ee60a (diff) |
Add a couple asserts to ensure a proper buffer
It should not be possible for a playing or paused source to not have a
valid buffer, but Clang's static analyzer doesn't know that. Hopefully
an assert will convince it.
-rw-r--r-- | OpenAL32/alSource.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/OpenAL32/alSource.c b/OpenAL32/alSource.c index 78ccef9a..16e3a930 100644 --- a/OpenAL32/alSource.c +++ b/OpenAL32/alSource.c @@ -2516,6 +2516,7 @@ static ALdouble GetSourceSecOffset(const ALsource *Source) Buffer = BufferList->buffer; BufferList = BufferList->next; } + assert(Buffer != NULL); return (ALdouble)readPos / (ALdouble)FRACTIONONE / (ALdouble)Buffer->Frequency; } @@ -2561,6 +2562,8 @@ static ALvoid GetSourceOffsets(const ALsource *Source, ALenum name, ALdouble *of } BufferList = BufferList->next; } + assert(Buffer != NULL); + if(Source->state == AL_PLAYING) writePos = readPos + (ALuint)(updateLen*Buffer->Frequency); else |