soloud
soloud copied to clipboard
Crash when loading ogg-Files
When loading certain ogg-files (which play fine in VLC), stb_vorbis_stream_length_in_samples
returns 0. This leads to a crash in Wav::loadogg
since no space is allocated.
Is there a good way to upload the problematic file here so that others can test it?
For now, I added
if( 0 == samples)
{
return FILE_LOAD_FAILED;
}
to Wav::loadogg
, which is the absolute minimum - currently the return value is not checked, leading to this crash, and a good library should never crash but return a proper error.
However, the more important part is understanding, why zero samples are returned. I looked into the code, but it is a bit too complicated to me. Hence I'd like to provide the example file so that someone with more knowledge can have a look at it.
I had this problem a few days ago elsewhere using the single header "stb" ogg decoder on my own engine.
Don't have the code with me atm but that field only becomes valid if the file is "prescanned".
Also... I was having a crash and traced it down to where ogg was looking for comments and my file had none. I noticed this had been fixed in a recent update.