1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:17:45 +00:00

LibGfx/JPEGXL: Align the stream to byte boundary before reading a frame

As this is stated in the spec, all frames are byte-aligned.
This commit is contained in:
Lucas CHOLLET 2023-07-21 23:00:59 -04:00 committed by Tim Flynn
parent ea88242d1c
commit 9975bdb2d1

View file

@ -1456,6 +1456,10 @@ static ErrorOr<Frame> read_frame(LittleEndianInputBitStream& stream,
ImageMetadata const& metadata,
Optional<EntropyDecoder>& entropy_decoder)
{
// F.1 - General
// Each Frame is byte-aligned by invoking ZeroPadToByte() (B.2.7)
stream.align_to_byte_boundary();
Frame frame;
frame.frame_header = TRY(read_frame_header(stream, metadata));