mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 09:06:08 +00:00
LibVideo: Always check byte length before reading first byte in Streamer
The check was missing at the front of MatroskaReader::Streamer::read_variable_size_integer, causing assertions on malformed input streams.
This commit is contained in:
parent
4507920187
commit
9d3074f72f
Notes:
sideshowbarker
2024-07-17 05:59:39 +09:00
Author: https://github.com/ADKaster
Commit: 9d3074f72f
Pull-request: https://github.com/SerenityOS/serenity/pull/15560
1 changed files with 4 additions and 0 deletions
|
@ -67,6 +67,10 @@ private:
|
|||
Optional<u64> read_variable_size_integer(bool mask_length = true)
|
||||
{
|
||||
dbgln_if(MATROSKA_TRACE_DEBUG, "Reading from offset {:p}", m_data_ptr);
|
||||
if (!has_octet()) {
|
||||
dbgln_if(MATROSKA_TRACE_DEBUG, "Ran out of stream data");
|
||||
return {};
|
||||
}
|
||||
auto length_descriptor = read_octet();
|
||||
dbgln_if(MATROSKA_TRACE_DEBUG, "Reading VINT, first byte is {:#02x}", length_descriptor);
|
||||
if (length_descriptor == 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue