Describe the bug
I encountered a "Segmentation fault" while calling stbi_load_gif_from_memory() with the animated gif from the GIF wikipedia french page.
tl;dr
I use gifsicle to optimise and fix animated gif that are not properly decoded with stb image:
My two cents first analysis
Using gdb, the segmentation fault occurs in stbi__gif_load_next().
I have tried more animated gif and I noticed that animated gif with "disposal background" work fine, others with "disposal previous" generate the segmentation fault.
To check the disposal mode, I use the famous gifsicle
gifsicle -I gif_creating_seg_fault_with stb_image.gif | grep "disposal" # you will have "disposal previous delay 0.04s"
gifsicle -I gif_ok_with_stb_image.gif | grep "disposal" # you will have "disposal background delay 0.04s"
Many thanks for this nice library :smile:
peace
coolcornucopia
Describe the bug I encountered a "Segmentation fault" while calling stbi_load_gif_from_memory() with the animated gif from the GIF wikipedia french page.
tl;dr I use gifsicle to optimise and fix animated gif that are not properly decoded with stb image:
To Reproduce I did a git repo to help reproducing the issue named https://github.com/coolcornucopia/stb-image-gif-apng-short-examples
Steps to reproduce the behavior:
The issue occurs when calling the stbi_load_gif_from_memory() function with the gif previously loaded in memory.
Expected behavior No segmentation fault for this animated gif from the GIF wikipedia french page :smile:.
My two cents first analysis Using gdb, the segmentation fault occurs in stbi__gif_load_next().
I have tried more animated gif and I noticed that animated gif with "disposal background" work fine, others with "disposal previous" generate the segmentation fault. To check the disposal mode, I use the famous gifsicle
Many thanks for this nice library :smile: peace coolcornucopia