FLTK logo

Re: [fltk/fltk] Fl_GIF_Image decoder bug (#274)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Fl_GIF_Image decoder bug (#274) wcout Sep 20, 2021  
 

Before I dig deeper into the code (this decoding algorithm looks pretty complicated), can you explain in a few more words why your fix is the correct one

I can understand you are concerned about side effects of this change - this decrementing of FreeCount is 20 year old code (I've followed it back to a commit for FLTK 1.1!).
Nevertheless I'm quite certain that it is plainly wrong, as explained already.
I have now looked into several implementations that claim to be gif2ras descendants (like FL_GIF_Image). None of them has that decrement of FreeCount, although the rest of the code is still similar.
I think it maybe intended to secure the code from buffer overflows and did not realize it could change the dictionary table.

IMHO the code with this fix is completely in the intention of the specification: Act like the table were as big as FreeCode, but do not store new values in the table.

how we can verify that it doesn't break other cases (w/o just testing lots of images)?

I fear apart from accurate code review from several people there is no other way than testing various images, like here:
https://github.com/robert-ancell/pygif/tree/master/test-suite


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications on the go with GitHub Mobile for iOS or Android.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.