diff --git a/Userland/Libraries/LibAudio/GenericTypes.cpp b/Userland/Libraries/LibAudio/GenericTypes.cpp index d7fdc27a2db..e40c04eb3af 100644 --- a/Userland/Libraries/LibAudio/GenericTypes.cpp +++ b/Userland/Libraries/LibAudio/GenericTypes.cpp @@ -40,6 +40,8 @@ Optional SeekTable::seek_point_before(u64 sample_index) const ++nearby_seek_point_index; while (nearby_seek_point_index > 0 && m_seek_points[nearby_seek_point_index].sample_index > sample_index) --nearby_seek_point_index; + if (m_seek_points[nearby_seek_point_index].sample_index > sample_index) + return {}; return m_seek_points[nearby_seek_point_index]; }