Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seg fault crash with ImageOptimizer.LosslessCompress for a specific jpg #378

Closed
3 tasks done
dabutvin opened this issue Feb 1, 2019 · 2 comments
Closed
3 tasks done
Labels
Milestone

Comments

@dabutvin
Copy link

dabutvin commented Feb 1, 2019

Prerequisites

  • I have written a descriptive issue title
  • I have verified that I am using the latest version of Magick.NET
  • I have searched open and closed issues to ensure it has not already been reported

Description

I have a jpg that, when running ImageOptimizer.LosslessCompress() causes a seg fault

Segmentation fault: 11

This happens every time and has reproduced on windows and mac with the latest Magick.NET 7.10.2
Note: this does not crash when calling Compress(). It only crashes when calling LosslessCompress().

I can repro this issue with OptimalCompression on and off, and with IgnoreUnsupportedFormats on and off.

Steps to Reproduce

I have a simple repro set up here: https://github.com/dabutvin/SaskArtists/tree/debug
This is a fork from the original issue trimmed down to a single image and includes a console app that demonstrates the failure. I could not get any additional logs out even when enabling the debug events.

Here is the console app that points to the troublesome image with a relative path
https://github.com/dabutvin/SaskArtists/blob/debug/magick/Program.cs

This is the image file: https://github.com/dabutvin/SaskArtists/blob/debug/www/artists/rarnott/images/snowy_painting.jpg

System Configuration

  • Magick.NET version: 7.10.2
  • Environment (Operating system, version and so on): MacOS Mojave 10.14.2 + Windows running in Azure Functions Consumption environment
@dlemstra dlemstra added the bug label Feb 1, 2019
@dlemstra
Copy link
Owner

dlemstra commented Feb 1, 2019

Thanks for finding this. This image contains a huge marker that is split up. The current code cannot handle that. And there is an incorrect buffer check that causes this access violation. Will take a look at it next week.

@dabutvin
Copy link
Author

dabutvin commented Feb 1, 2019

Awesome! Let me know how it goes or if you need anything.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants