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.
This commit is contained in:
parent
f311f74001
commit
debd5346fb
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user