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

Plugin runs into infinite loop when loading certain gif with relatively large width and height. #8

Open
MagickPanda opened this issue Feb 11, 2024 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@MagickPanda
Copy link

Hello, I am experiencing a editor freeze problem when auto-importing a few gif that is relatively large in both filesize and image w/h dimensions.

I looked into the code a bit and add a few prints to pinpoint the culprit of the freeze.

The error message:

Running GIF to SpriteFrames Importer
Running GIF to SpriteFrames Importer
Running GIF to SpriteFrames Importer
Running GIF to SpriteFrames Importer
Image Width: 635
Image Width: 635
Image Width: 635
Image Width: 635
Image Height: 687
Image Height: 1325
Image Height: 900
Image Height: 689
Too many record attempts!100
ERROR: (null)
at: godot::GifLoadTeoro: :mgainfy_ errercoorr d( sartct\eimmpatgse!_1f0r0a
mes.cpp:56)
ERROR: (null)
at: godot::GifLoader::gif_error (src\image_frTaomoe sm.acnpyp :r5e6c)o
rd attempts!100
ERROR: (null)

It seems the plugins function GifLoader::_load_frames is querying the info of gif header infinitely via DGifGetRecordType(gif, &recordType) function from dlib_gif libary. I added a counter to make it error out upon 100 attempts it seems to finally exits the infinite loop that caused editor freeze.

The failing gif, it's from docs from resonate plugin:
add-music-resource

The modified source code based on master repo:
src.zip

I am still new to gds extension stuff and not familiar with gif header struct or dlib_gif library, so hopefully someone will be able to pinpoint the problem causing the header check erratic behaviors.

Thanks.

@BOTLANNER BOTLANNER added bug Something isn't working help wanted Extra attention is needed labels Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants