Commit c45afa01 authored by David Reid's avatar David Reid

Add a pedantic fread() compatibility check to the vorbis decoder.

parent 22965c2f
......@@ -90,6 +90,11 @@ static size_t ma_libvorbis_vf_callback__read(void* pBufferOut, size_t size, size
size_t bytesToRead;
size_t bytesRead;
/* For consistency with fread(). If `size` of `count` is 0, return 0 immediately without changing anything. */
if (size == 0 || count == 0) {
return 0;
}
bytesToRead = size * count;
result = pVorbis->onRead(pVorbis->pReadSeekTellUserData, pBufferOut, bytesToRead, &bytesRead);
......
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