Commit 3181b0c2 authored by David Reid's avatar David Reid

Fix a bug when decoding from memory.

parent 244ef260
...@@ -52780,6 +52780,10 @@ static ma_result ma_decoder__on_read_memory(ma_decoder* pDecoder, void* pBufferO ...@@ -52780,6 +52780,10 @@ static ma_result ma_decoder__on_read_memory(ma_decoder* pDecoder, void* pBufferO
MA_ASSERT(pDecoder->data.memory.dataSize >= pDecoder->data.memory.currentReadPos); MA_ASSERT(pDecoder->data.memory.dataSize >= pDecoder->data.memory.currentReadPos);
if (pBytesRead != NULL) {
*pBytesRead = 0;
}
bytesRemaining = pDecoder->data.memory.dataSize - pDecoder->data.memory.currentReadPos; bytesRemaining = pDecoder->data.memory.dataSize - pDecoder->data.memory.currentReadPos;
if (bytesToRead > bytesRemaining) { if (bytesToRead > bytesRemaining) {
bytesToRead = bytesRemaining; bytesToRead = bytesRemaining;
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