From e813b8fd197c60a299dbb96f9b46c18143f46148 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Sat, 11 Feb 2023 20:08:09 -0600 Subject: [PATCH] LibVideo/Matroska: Fix out-of-bounds access when seeking to cues --- Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp index a0e9c780f0..70551ae07f 100644 --- a/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp +++ b/Userland/Libraries/LibVideo/Containers/Matroska/Reader.cpp @@ -797,8 +797,8 @@ DecoderErrorOr Reader::seek_to_cue_for_timestamp(SampleIterator& iterator, return {}; } - while (index < cue_points.size()) { - auto const& cue_point = cue_points[++index]; + while (++index < cue_points.size()) { + auto const& cue_point = cue_points[index]; dbgln_if(MATROSKA_DEBUG, "Checking future cue point {}ms", cue_point.timestamp().to_milliseconds()); if (cue_point.timestamp() > timestamp) break;