mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
AK: Don't slice off the first byte of a BitStream read
This commit is contained in:
parent
4280f4d2c7
commit
de49413bdf
1 changed files with 2 additions and 2 deletions
|
@ -29,8 +29,8 @@ public:
|
||||||
{
|
{
|
||||||
if (m_current_byte.has_value() && is_aligned_to_byte_boundary()) {
|
if (m_current_byte.has_value() && is_aligned_to_byte_boundary()) {
|
||||||
bytes[0] = m_current_byte.release_value();
|
bytes[0] = m_current_byte.release_value();
|
||||||
// FIXME: This accidentally slices off the first byte of the returned span.
|
auto freshly_read_bytes = TRY(m_stream->read_some(bytes.slice(1)));
|
||||||
return m_stream->read_some(bytes.slice(1));
|
return bytes.trim(1 + freshly_read_bytes.size());
|
||||||
}
|
}
|
||||||
align_to_byte_boundary();
|
align_to_byte_boundary();
|
||||||
return m_stream->read_some(bytes);
|
return m_stream->read_some(bytes);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue