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

LibGfx: Rename "skip_marker_with_length" to "skip_segment"

As it, in fact, does not skip a marker but a segment :^).
This commit is contained in:
Lucas CHOLLET 2023-02-19 20:22:45 -05:00 committed by Andreas Kling
parent 9096b4d893
commit 90573652fd

View file

@ -851,7 +851,7 @@ static ErrorOr<void> read_quantization_table(AK::SeekableStream& stream, JPEGLoa
return {}; return {};
} }
static ErrorOr<void> skip_marker_with_length(Stream& stream) static ErrorOr<void> skip_segment(Stream& stream)
{ {
u16 bytes_to_skip = TRY(stream.read_value<BigEndian<u16>>()) - 2; u16 bytes_to_skip = TRY(stream.read_value<BigEndian<u16>>()) - 2;
TRY(stream.discard(bytes_to_skip)); TRY(stream.discard(bytes_to_skip));
@ -1161,7 +1161,7 @@ static ErrorOr<void> parse_header(AK::SeekableStream& stream, JPEGLoadingContext
case JPEG_SOS: case JPEG_SOS:
return read_start_of_scan(stream, context); return read_start_of_scan(stream, context);
default: default:
if (auto result = skip_marker_with_length(stream); result.is_error()) { if (auto result = skip_segment(stream); result.is_error()) {
dbgln_if(JPEG_DEBUG, "{}: Error skipping marker: {:x}!", TRY(stream.tell()), marker); dbgln_if(JPEG_DEBUG, "{}: Error skipping marker: {:x}!", TRY(stream.tell()), marker);
return result.release_error(); return result.release_error();
} }