SixLabors / ImageSharp

:camera: A modern, cross-platform, 2D Graphics library for .NET

Home Page:https://sixlabors.com/products/imagesharp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JPEG Parse Fails If APP0 doesn't immediately follow SOI

QuinnDamerell opened this issue · comments

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am running the latest version of ImageSharp
  • I have verified if the problem exist in both DEBUG and RELEASE mode
  • I have searched open and closed issues to ensure it has not already been reported

ImageSharp version

v3.0.2

Other ImageSharp packages and versions

None

Environment (Operating system, version and so on)

Linux

.NET Framework version

dotnet core 7.0

Description

I run a service that processes webcam images from many users. These webcam images come from a variety of webcam servers, some mjpg-streamer, webcam streamer, IP cameras, and more. I have recently encountered an issue where one of the webcam servers seems to be using a weird jpeg image format, where the FF DB (DQT) comes before the FF E0 (APP0). Here's a hex dump of the headers from an image:

image

The ImageSharp lib seems always to need the ``FF E0to follow theFF D8`. The fix would be to allow these header-type byte formats to be consumed in different orders.

Steps to Reproduce

Produce a JPEG image with at DQT header and move the DQT header before the APP0 header.

Images

No response

Actually, I was incorrect; the issue seems to be fixed with this fix.

492507f

That change was made on Jun 23 of this year, and the latest release is from Aug 29th, do you have any idea when that change will make it to the release branch?

It's going to be part of the v3.1 release which I've targeted to release at the end of the month. You can use our nightly releases in the interim (see readme) if you need it sooner.