Skip to content

Decoding JPEG puts the process to infinite loop if there is an error on JPEG bytes #214

@xeora

Description

@xeora

The problem appears when you want to resize a JPEG with crop options.

Problematic code piece is the following;
https://github.com/JimBobSquarePants/ImageSharp/blob/master/src/ImageSharp/Formats/Jpeg/Components/Decoder/InputProcessor.cs#L156

I made a hotfix for myself by changing the code like

while (length > 0 && errorCode == DecoderErrorCode.NoError)

But surely, I didn't test anything else if it breaks something more. Currently working okay in my environment.

It requires deep investigation if it is the correct fix or not...

thanks...

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions