Commit f4d8a537 authored by David Reid's avatar David Reid

Check the return value when data is read from a libvorbis file.

parent 593897f1
......@@ -99,6 +99,10 @@ static size_t ma_libvorbis_vf_callback__read(void* pBufferOut, size_t size, size
bytesToRead = size * count;
result = pVorbis->onRead(pVorbis->pReadSeekTellUserData, pBufferOut, bytesToRead, &bytesRead);
if (result != MA_SUCCESS) {
/* Not entirely sure what to return here. What if an error occurs, but some data was read and bytesRead is > 0? */
return 0;
}
return bytesRead / size;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment