summaryrefslogtreecommitdiff
path: root/modules/ogg
diff options
context:
space:
mode:
authorstmSi <stm1998sithumyo@gmail.com>2023-01-13 13:39:03 +0630
committerstmSi <stm1998sithumyo@gmail.com>2023-01-13 13:39:03 +0630
commitf286e93fef4a74c5efbb024d7634d4fa6a9eb127 (patch)
tree16de78279250bb3a6bf739afd630f208edde3c22 /modules/ogg
parent7c2768c2f8abc2e81a55be72b436de69d9f01bf9 (diff)
Fix OGG page_data out of bound crash
Diffstat (limited to 'modules/ogg')
-rw-r--r--modules/ogg/ogg_packet_sequence.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/ogg/ogg_packet_sequence.cpp b/modules/ogg/ogg_packet_sequence.cpp
index 0acaaf5fc9..d473f3b4a0 100644
--- a/modules/ogg/ogg_packet_sequence.cpp
+++ b/modules/ogg/ogg_packet_sequence.cpp
@@ -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(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(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.
while (packet_cursor >= ogg_packet_sequence->page_data[page_cursor].size()) {
packet_cursor = 0;