LibMedia: Return an error if a Matroska octet couldn't be read

This commit is contained in:
Zaggy1024 2026-03-29 02:47:08 -05:00 committed by Gregory Bertilson
parent fea33aa02f
commit 36ddc5015a

View file

@ -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];
}