mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-23 16:54:03 +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;
|
framesToTryReading = framesRemaining;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (framesToTryReading > 0) {
|
||||||
pDst = ma_offset_ptr(
|
pDst = ma_offset_ptr(
|
||||||
pDataBufferNode->data.decoded.pData,
|
pDataBufferNode->data.decoded.pData,
|
||||||
pDataBufferNode->data.decoded.decodedFrameCount * ma_get_bytes_per_frame(pDataBufferNode->data.decoded.format, pDataBufferNode->data.decoded.channels)
|
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) {
|
if (framesRead > 0) {
|
||||||
pDataBufferNode->data.decoded.decodedFrameCount += framesRead;
|
pDataBufferNode->data.decoded.decodedFrameCount += framesRead;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
framesRead = 0;
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case ma_resource_manager_data_supply_type_decoded_paged:
|
case ma_resource_manager_data_supply_type_decoded_paged:
|
||||||
|
|||||||
Reference in New Issue
Block a user