Skip to content

#797 throw ImageFormatException when no StartOfFrame marker is found - #801

Merged
JimBobSquarePants merged 2 commits into
SixLabors:masterfrom
jongleur1983:797-LoadThrowsNRE-bySharpFuzz
Jan 6, 2019
Merged

JimBobSquarePants merged 2 commits into
SixLabors:masterfrom
jongleur1983:797-LoadThrowsNRE-bySharpFuzz

Conversation

@jongleur1983

@jongleur1983 jongleur1983 commented Jan 4, 2019 •

Copy link
Copy Markdown
Contributor

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 matches 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 #797:

For jpg images where we can't find a valid SOF (start of frame) marker we now throw an ImageFormatException reporting that fact instead of a NullReferenceException.

Added the failing image from the issue for a test case.

Comment thread src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs Outdated
@codecov

codecov Bot commented Jan 4, 2019

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@db0fc0d). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #801   +/-   ##
=========================================
  Coverage          ?   88.79%           
=========================================
  Files             ?     1012           
  Lines             ?    43313           
  Branches          ?     3124           
=========================================
  Hits              ?    38459           
  Misses            ?     4156           
  Partials          ?      698
Impacted Files Coverage Δ
tests/ImageSharp.Tests/TestImages.cs 100% <ø> (ø)
...arp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs 86.66% <100%> (ø)
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs 87.75% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db0fc0d...59d76a0. Read the comment docs.

1 similar comment
@codecov

codecov Bot commented Jan 4, 2019

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@db0fc0d). Click here to learn what that means.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #801   +/-   ##
=========================================
  Coverage          ?   88.79%           
=========================================
  Files             ?     1012           
  Lines             ?    43313           
  Branches          ?     3124           
=========================================
  Hits              ?    38459           
  Misses            ?     4156           
  Partials          ?      698
Impacted Files Coverage Δ
tests/ImageSharp.Tests/TestImages.cs 100% <ø> (ø)
...arp.Tests/Formats/Jpg/JpegDecoderTests.Baseline.cs 86.66% <100%> (ø)
src/ImageSharp/Formats/Jpeg/JpegDecoderCore.cs 87.75% <100%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db0fc0d...59d76a0. Read the comment docs.

@JimBobSquarePants JimBobSquarePants left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

@JimBobSquarePants
JimBobSquarePants merged commit 441942b into SixLabors:master Jan 6, 2019
@jongleur1983
jongleur1983 deleted the 797-LoadThrowsNRE-bySharpFuzz branch November 1, 2019 20:16
antonfirsov pushed a commit to antonfirsov/ImageSharp that referenced this pull request Nov 11, 2019
…bySharpFuzz

SixLabors#797 throw ImageFormatException when no StartOfFrame marker is found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants