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.
This commit is contained in:
David Reid
2025-02-23 14:20:16 +10:00
parent c3b0a7fbbc
commit 5c0724ad59
+1 -1
View File
@@ -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);
if (framesRead > 0) {
if (result == MA_SUCCESS && framesRead > 0) {
pPage->sizeInFrames = framesRead;
result = ma_paged_audio_buffer_data_append_page(&pDataBufferNode->data.backend.decodedPaged.data, pPage);