Skip to content

Enhance decoders with segment integrity handling#3119

Open
JimBobSquarePants wants to merge 3 commits intomainfrom
js/proper-segment-integrity-handling
Open

Enhance decoders with segment integrity handling#3119
JimBobSquarePants wants to merge 3 commits intomainfrom
js/proper-segment-integrity-handling

Conversation

@JimBobSquarePants
Copy link
Copy Markdown
Member

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the existing coding patterns and practice as demonstrated in the repository. These follow strict Stylecop rules 👮.
  • I have provided test coverage for my change (where applicable)

Description

Fixes #3118

This pull request introduces improved error handling and segment integrity policies for image decoding. The main focus is on making ancillary segment parsing (such as ICC profiles, comments, and application extensions) more robust and configurable, ensuring that malformed or incomplete segments are handled according to the decoder's integrity policy.

/// <param name="stream">The <see cref="BufferedReadStream"/> containing image data.</param>
/// <param name="metadata">The image metadata.</param>
/// <param name="infoHeaderStart">The stream position where the info header begins.</param>
private void ReadIccProfile(BufferedReadStream stream, ImageMetadata metadata, long infoHeaderStart)
private void ReadOptionalChunk(
BufferedReadStream stream,
WebpChunkType chunkType,
ImageMetadata metadata,
Comment thread src/ImageSharp/Formats/ImageDecoderCore.cs Fixed
Comment thread src/ImageSharp/Formats/ImageDecoderCore.cs Fixed
…tch block'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Correctly handle Multiple SOF with SOS data

1 participant