Commit 5c0724ad authored by David Reid's avatar David Reid

Fix an extremely unlikely bug with the resource manager.

This checks the result of reading from the decoder when asynchronously
loading a file. In practice the existing check already covers this, but
it's technically possible for an error result the be skipped over.
parent c3b0a7fb
...@@ -68853,7 +68853,7 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour ...@@ -68853,7 +68853,7 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour
} }
result = ma_decoder_read_pcm_frames(pDecoder, pPage->pAudioData, framesToTryReading, &framesRead); result = ma_decoder_read_pcm_frames(pDecoder, pPage->pAudioData, framesToTryReading, &framesRead);
if (framesRead > 0) { if (result == MA_SUCCESS && framesRead > 0) {
pPage->sizeInFrames = framesRead; pPage->sizeInFrames = framesRead;
result = ma_paged_audio_buffer_data_append_page(&pDataBufferNode->data.backend.decodedPaged.data, pPage); result = ma_paged_audio_buffer_data_append_page(&pDataBufferNode->data.backend.decodedPaged.data, pPage);
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