icculus / mojoAL

An SDL2-based implementation of OpenAL in a single C file.
https://icculus.org/mojoAL/
zlib License
158 stars 21 forks source link

Null-pointer exceptions when getting Source state with no buffers #9

Closed ivan-mogilko closed 2 years ago

ivan-mogilko commented 2 years ago

It's possible to experience a null-pointer exception when trying to retrieve some of the Source properties, such as AL_SEC_OFFSET, and similar, from the Source that has no buffers attached.

As seen here: https://github.com/icculus/mojoAL/blob/main/mojoal.c#L4211 in a non-streaming case mojoAl accesses a buffer in order to find out offset, but does not test if the buffer pointer is valid.