mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
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:
+1
-1
@@ -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);
|
||||||
|
|||||||
Reference in New Issue
Block a user