kohler / gifsicle

Create, manipulate, and optimize GIF images and animations
http://www.lcdf.org/gifsicle/
GNU General Public License v2.0
3.72k stars 235 forks source link

Segmentation fault for some GIF files #206

Open pdobrescu opened 1 month ago

pdobrescu commented 1 month ago

Hello, and thanks for the very useful tool!

We use it to compress GIF files and for some files, we get a segmentation fault error when running it like this:

gifsicle -O3 --lossy=10 --colors=256 /path/to/source.gif -o /path/to/destination.gif

Here's an example file that returns this error:

video_omnichannel-drag-drop

Any ideas/suggestions would be more than welcome! Thanks!

kohler commented 1 month ago

I'm not replicating this with the provided GIF. Can you say which version of gifsicle you're using and which platform?

pdobrescu commented 1 month ago

Thanks for the quick response! We're using gifsicle 1.96 on various versions of Debian (mostly 10 and 11). Please tell me if you need any other details!

Later edit: here's more details:

/tmp/gifsicle # more /etc/debian_version 
11.9
/tmp/gifsicle # gifsicle --version
LCDF Gifsicle 1.96
Copyright (C) 1997-2024 Eddie Kohler
This is free software; see the source for copying conditions.
There is NO warranty, not even for merchantability or fitness for a
particular purpose.
/tmp/gifsicle # gifsicle -O3 --lossy=10 --colors=256 t.gif -o t2.gif
gifsicle: warning: trivial adaptive palette (only 127 colors in source)
Segmentation fault
/tmp/gifsicle #

I guess we have a version that hasn't been publicly released yet and if I remember well, it contains a bug fix that we reported sometime last ~week~ year. Thanks!

pdobrescu commented 1 month ago

After speaking with my colleague @simondud, this is the issue that was fixed in this commit. After the commit, we took the master branch, built it and that's what we currently use (and returns the segmentation error above).

Please tell me if you need more details. Thanks!

P.S. We are happy to donate to the development of this project, so please tell us if you have any system where we could financially contribute to your project.

kohler commented 1 week ago

Hi @pdobrescu, I think I misunderstood your comment. I thought you said that the current master branch does not crash, but you're saying it does. Let me look again.

kohler commented 1 week ago

On x86-64 Amazon Linux, I see no segmentation fault. This is compiled with -fsanitize=undefined -fsanitize=address. The sha256sum of the input GIF is 678379dab089044e55de5baa3219411d84642ead6ae12cb2a48ab70db09a2aa6; I am using -O3 --lossy=10 --colors=256 and commit 338d286490750a4cc1ba728ddd4588bf46027ff7.

kohler commented 1 week ago

So I do need more details. Feel free to use email for that, or here is also fine.