View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0034919 | FPC | Packages | public | 2019-01-21 14:11 | 2019-02-21 21:07 |
Reporter | zaxxon | Assigned To | Marco van de Voort | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | All | OS | All | ||
Product Version | 3.0.4 | ||||
Fixed in Version | 3.3.1 | ||||
Summary | 0034919: Gif reader in FPC hangs when trying to read the attached gif file | ||||
Description | When trying to load the gif file "linux.gif", the gif reader simply hangs. | ||||
Steps To Reproduce | Simply drop a TImage in a form in Lazarus and try to load the attached file. This will cause the entire Lazarus to hang. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | 40995 | ||||
FPCOldBugId | |||||
FPCTarget | |||||
Attached Files |
|
related to | 0035134 | closed | Michael Van Canneyt | fpreadgif: r40995 broke paletted GIF reading |
|
|
|
The Gif is invalid? --------------------------- IrfanView --------------------------- C:\......\linux.gif : Decode error ! Invalid or unsupported GIF file. --------------------------- OK --------------------------- |
|
The gif can be open in other programs. I think it's greyscale. Small changes in FPReadGif prevents it from ending up in infinite loops. in Internal read : // skip extensions Repeat Introducer:=SkipBlock(Stream); until (Introducer = $2C) or (Introducer = $3B) or (Stream.Position>=Stream.Size); if Stream.Position>=Stream.Size then Exit; and in Readscanline on two locations: Repeat Stream.read(B, 1); if B > 0 then begin Stream.ReadBuffer(SourcePtr^, B); Inc(SourcePtr,B); end; until (B = 0) or (Stream.Position>=Stream.Size); if Stream.Position>Stream.Size then begin ReadScanLine:=False; Exit; end; At least this prevent the gif reader to end up in infinite loop. When trying to load unsupported gifs. |
|
The gif is invalid. Even Chromium will not accept it. There are multiple ways to check the validity already, including brute force exception handling. This is a non-issue. |
|
Internet explorer opened it. I think even if the gif file is invalid the reader shouldn't end up in an infinite loop. I should be protected from that. |
|
You are a programmer, not an end user? |
|
Anyway I used the changes presented in the post above and that solved it for me, so i'm happy. But i still think some changes at least should be made to the existing code. To prevent infinite loops. |
|
Applied, thanks. Thaddy, please keep the noise down. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-01-21 14:11 | zaxxon | New Issue | |
2019-01-21 14:11 | zaxxon | File Added: linux.gif | |
2019-01-21 22:23 | Bart Broersma | Note Added: 0113554 | |
2019-01-22 09:05 | zaxxon | Note Added: 0113564 | |
2019-01-22 09:31 | Thaddy de Koning | Note Added: 0113566 | |
2019-01-22 09:34 | Thaddy de Koning | Note Edited: 0113566 | View Revisions |
2019-01-22 09:55 | zaxxon | Note Added: 0113568 | |
2019-01-22 11:08 | Thaddy de Koning | Note Added: 0113574 | |
2019-01-22 12:00 | zaxxon | Note Added: 0113577 | |
2019-01-22 16:11 | Marco van de Voort | Fixed in Revision | => 40995 |
2019-01-22 16:11 | Marco van de Voort | Note Added: 0113584 | |
2019-01-22 16:11 | Marco van de Voort | Status | new => resolved |
2019-01-22 16:11 | Marco van de Voort | Fixed in Version | => 3.3.1 |
2019-01-22 16:11 | Marco van de Voort | Resolution | open => fixed |
2019-01-22 16:11 | Marco van de Voort | Assigned To | => Marco van de Voort |
2019-02-21 21:07 | Marco van de Voort | Relationship added | related to 0035134 |