https://bugs.winehq.org/show_bug.cgi?id=54526
Bug ID: 54526 Summary: Failed to parse the gif file, resulting in the failure to load the gif and thus enter the program Product: Wine Version: 8.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: blocker Priority: P2 Component: gdiplus Assignee: wine-bugs@winehq.org Reporter: 399989567@qq.com Distribution: ---
Nowadays wine is successful in parsing some gifs, and some gifs cannot be parsed.
I'm using a game that has a gif on its loading page, and now the program doesn't work because the gif fails to parse (it doesn't matter which game it is, because I've written a simple demo that reproduces the problem)
The demo is for windows 10, and the content of the demo is to play a file named "1.gif".
So you need to rename the file to "1.gif" and put it in the compiled . /wine in the same directory. This will allow the demo to run correctly.
"1_ok.gif" is a gif file that can be parsed normally, "1_fail.gif" is a gif file that can't be parsed normally.
I hope my demo is helpful to solve this problem.
Translated with www.DeepL.com/Translator (free version)
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #1 from 399989567@qq.com --- Created attachment 74063 --> https://bugs.winehq.org/attachment.cgi?id=74063 demo
It's a demo written in VS for windows 10
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #2 from 399989567@qq.com --- Created attachment 74064 --> https://bugs.winehq.org/attachment.cgi?id=74064 1_ok.gif
Remember to rename it to "1.gif" when you use it
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #3 from 399989567@qq.com --- Created attachment 74065 --> https://bugs.winehq.org/attachment.cgi?id=74065 1_fail.gif
Remember to rename it to "1.gif" when you use it
https://bugs.winehq.org/show_bug.cgi?id=54526
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download Severity|blocker |normal
--- Comment #4 from Austin English austinenglish@gmail.com --- Can you please attach the source for your demo?
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #5 from 399989567@qq.com --- Created attachment 74069 --> https://bugs.winehq.org/attachment.cgi?id=74069 source.c
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #6 from 399989567@qq.com --- (In reply to Austin English from comment #4)
Can you please attach the source for your demo?
yes,I can. The "source.c" is the source file for the demo.
The problom function "DGifSlurp"
https://bugs.winehq.org/show_bug.cgi?id=54526
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |testcase
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #7 from 399989567@qq.com --- (In reply to Austin English from comment #4)
Can you please attach the source for your demo?
The gif is 305 * 299 , but I fount in DGifSlurp at "case IMAGE_DESC_RECORD_TYPE:",when GifFile->ImageCount == 114, the sp->ImageDesc.Width = 302; // not 305 sp->ImageDesc.Height = 299;
https://bugs.winehq.org/show_bug.cgi?id=54526
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Ever confirmed|0 |1 Status|UNCONFIRMED |NEW
--- Comment #8 from Dmitry Timoshkov dmitry@baikal.ru --- There are 2 problems with the attached test: 1. 1_fail.gif premature terminates one of the GIF frames before all declared line data have been decompressed. Declared line length exceeds actually decompressed data by 4 bytes. Looks like this situation is not considered as a failure by Windows GIF decoder. 2. The application needs support for 8 bpp indexed to 24 bpp BGR data in order to paint GIF frame data on the screen.
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #9 from Dmitry Timoshkov dmitry@baikal.ru --- Created attachment 74083 --> https://bugs.winehq.org/attachment.cgi?id=74083 2 patches for testing
Attached patches fix the problem with the provided test app for me.
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #10 from 399989567@qq.com --- (In reply to Dmitry Timoshkov from comment #9)
Created attachment 74083 [details] 2 patches for testing
Attached patches fix the problem with the provided test app for me.
I would like to ask is this problem solved?
I also want to ask how to use the patches
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #11 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to 399989567 from comment #10)
I would like to ask is this problem solved?
I also want to ask how to use the patches
You would need to apply the patches to Wine source and then do the build. Instructions on how to do that should be available in the Wiki. Please consult the Wine forums for further help.
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #12 from 399989567@qq.com --- (In reply to Dmitry Timoshkov from comment #11)
(In reply to 399989567 from comment #10)
I would like to ask is this problem solved?
I also want to ask how to use the patches
You would need to apply the patches to Wine source and then do the build. Instructions on how to do that should be available in the Wiki. Please consult the Wine forums for further help.
I saw your edit, about "Don't fail on EOF code if the GIF line is premature terminated." I agree with your edit, I did the same before your reply, and it fixed the problem too.
I would like to ask about the modification of "Add support for 8bpp indexed to 24bpp BGR color conversion." What is the reason for this modification. Only through debug wine I didn't get here
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #13 from 399989567@qq.com --- (In reply to 399989567 from comment #12)
I would like to ask about the modification of "Add support for 8bpp indexed to 24bpp BGR color conversion." What is the reason for this modification. Only through debug wine I didn't get here
Even if I don't make this modification I still successfully display the gif file
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #14 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to 399989567 from comment #13)
I would like to ask about the modification of "Add support for 8bpp indexed to 24bpp BGR color conversion." What is the reason for this modification. Only through debug wine I didn't get here
Even if I don't make this modification I still successfully display the gif file
That's correct, looks like this patch is only needed for my own WIC test. Thanks for testing.
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #15 from 399989567@qq.com --- Created attachment 74084 --> https://bugs.winehq.org/attachment.cgi?id=74084 1_background_fail.gif
Running this gif with my demo produces the wrong background color (black)
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #16 from 399989567@qq.com --- (In reply to Dmitry Timoshkov from comment #14)
(In reply to 399989567 from comment #13)
I would like to ask about the modification of "Add support for 8bpp indexed to 24bpp BGR color conversion." What is the reason for this modification. Only through debug wine I didn't get here
Even if I don't make this modification I still successfully display the gif file
That's correct, looks like this patch is only needed for my own WIC test. Thanks for testing.
I found a new bug, this gif file will have wrong background color
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #17 from 399989567@qq.com --- Created attachment 74085 --> https://bugs.winehq.org/attachment.cgi?id=74085 1_background_pick.gif
Another problem, not the same problem as 1_background_fail.gif (I personally don't think it's a problem)
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #18 from 399989567@qq.com --- (In reply to 399989567 from comment #17)
Created attachment 74085 [details] 1_background_pick.gif
Another problem, not the same problem as 1_background_fail.gif (I personally don't think it's a problem)
I personally don't think it's a problem -> I personally don't think it's the same problem
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #19 from Dmitry Timoshkov dmitry@baikal.ru --- (In reply to 399989567 from comment #17)
Created attachment 74085 [details] 1_background_pick.gif
Another problem, not the same problem as 1_background_fail.gif (I personally don't think it's a problem)
Please create a separate bug report for another problem, or if there is an existing one - point it out.
If in order to reproduce the problem it's required to use a program that requires creating an account I'm afraid that's not an option. Having a test application (with source) would be helpful.
https://bugs.winehq.org/show_bug.cgi?id=54526
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|gdiplus |windowscodecs
https://bugs.winehq.org/show_bug.cgi?id=54526
--- Comment #20 from 399989567@qq.com --- (In reply to Dmitry Timoshkov from comment #19)
(In reply to 399989567 from comment #17)
Created attachment 74085 [details] 1_background_pick.gif
Another problem, not the same problem as 1_background_fail.gif (I personally don't think it's a problem)
Please create a separate bug report for another problem, or if there is an existing one - point it out.
If in order to reproduce the problem it's required to use a program that requires creating an account I'm afraid that's not an option. Having a test application (with source) would be helpful.
# bug 54563
https://bugs.winehq.org/show_bug.cgi?id=54526
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com