mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 09:14:04 +02:00
Fix a bug where decoding would try to read 0 frames and throw an error.
This commit is contained in:
@@ -56556,6 +56556,7 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour
|
||||
framesToTryReading = framesRemaining;
|
||||
}
|
||||
|
||||
if (framesToTryReading > 0) {
|
||||
pDst = ma_offset_ptr(
|
||||
pDataBufferNode->data.decoded.pData,
|
||||
pDataBufferNode->data.decoded.decodedFrameCount * ma_get_bytes_per_frame(pDataBufferNode->data.decoded.format, pDataBufferNode->data.decoded.channels)
|
||||
@@ -56566,6 +56567,9 @@ static ma_result ma_resource_manager_data_buffer_node_decode_next_page(ma_resour
|
||||
if (framesRead > 0) {
|
||||
pDataBufferNode->data.decoded.decodedFrameCount += framesRead;
|
||||
}
|
||||
} else {
|
||||
framesRead = 0;
|
||||
}
|
||||
} break;
|
||||
|
||||
case ma_resource_manager_data_supply_type_decoded_paged:
|
||||
|
||||
Reference in New Issue
Block a user