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

SIGBUS while loading huge gifs #50

Closed
HakierGrzonzo opened this issue Feb 6, 2021 · 1 comment
Closed

SIGBUS while loading huge gifs #50

HakierGrzonzo opened this issue Feb 6, 2021 · 1 comment

Comments

@HakierGrzonzo
Copy link

While attempting to view a 2gb gif file (youtube-dl > ffmpeg > gif) chafa crashed with following message:

fish: “chafa rickroll.gif” terminated by signal SIGBUS (Misaligned address error)

Firefox plays this gif without errors.

@hpjansson
Copy link
Owner

Thanks for reporting the issue! You madman.

The embedded libnsgif uses signed 32-bit int offsets into the mmapped file, resulting in any file >= 2GiB being flagged as unreadable. Chafa then falls back to the ImageMagick decoder, which tries to decode the entire file to temp buffers before proceeding. At this point it runs out of memory.

I'm committing a fix to master that makes libnsgif use 64-bit offsets. Please let me know if the problem doesn't go away.

hpjansson added a commit that referenced this issue Feb 7, 2021
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

No branches or pull requests

2 participants