Fix OGG page_data out of bound crash

This commit is contained in:
stmSi 2023-01-13 13:39:03 +06:30
parent 7c2768c2f8
commit f286e93fef
1 changed files with 2 additions and 0 deletions

View File

@ -136,6 +136,8 @@ bool OggPacketSequencePlayback::next_ogg_packet(ogg_packet **p_packet) const {
ERR_FAIL_COND_V(data_version != ogg_packet_sequence->data_version, false); ERR_FAIL_COND_V(data_version != ogg_packet_sequence->data_version, false);
ERR_FAIL_COND_V(ogg_packet_sequence->page_data.is_empty(), false); ERR_FAIL_COND_V(ogg_packet_sequence->page_data.is_empty(), false);
ERR_FAIL_COND_V(ogg_packet_sequence->page_granule_positions.is_empty(), false); ERR_FAIL_COND_V(ogg_packet_sequence->page_granule_positions.is_empty(), false);
ERR_FAIL_COND_V(page_cursor >= ogg_packet_sequence->page_data.size(), false);
// Move on to the next page if need be. This happens first to help simplify seek logic. // Move on to the next page if need be. This happens first to help simplify seek logic.
while (packet_cursor >= ogg_packet_sequence->page_data[page_cursor].size()) { while (packet_cursor >= ogg_packet_sequence->page_data[page_cursor].size()) {
packet_cursor = 0; packet_cursor = 0;