LibMedia: Return an error if a Matroska octet couldn't be read
This commit is contained in:
parent
fea33aa02f
commit
36ddc5015a
1 changed files with 3 additions and 1 deletions
|
|
@ -36,7 +36,9 @@ DecoderErrorOr<u8> Streamer::read_octet()
|
|||
{
|
||||
u8 result;
|
||||
Bytes bytes { &result, 1 };
|
||||
TRY(m_stream_cursor->read_into(bytes));
|
||||
auto bytes_read = TRY(m_stream_cursor->read_into(bytes));
|
||||
if (bytes_read != 1)
|
||||
return DecoderError::corrupted("Failed to read octet"sv);
|
||||
return bytes[0];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue