mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-23 09:51:57 -05: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
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
Reference in a new issue