[Magick-bugs] gif.c: only the first unrecognized application extension blocks is returned

Richard legalize at xmission.com
Sat May 19 10:03:16 PDT 2007


In gif.c, there is some code for processing application extension
blocks.  On line 1060, num_app_exts is declared and initialized to
zero.  This variable is incremented for each application extension
block and is only used to synthesize a profile name of "GIFAP%03d000".

However, because it is declared at the scope of "found an application
extension", every time the name is synthesized it comes out GIFAP0010
instead of incrementing by one each time an unrecognize extension
block is found.  Because the extension blocks can only be retrieved as
profile names, this means that you'll only get the last extension
block in the GIF file.

If the variable is moved to the outer scope, such as line 1007, then
the names increment one for each unrecognized extension block.

I ran into this when attempting to process the extension blocks in a
GIF file produced by fractint, which writes one or more extension
blocks to store data about resuming a partially rendered fractal.  An
example file can be found at
<http://www.xmission.com/~legalize/fractals/fractdev/fract001.gif>
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
      <http://www.xmission.com/~legalize/book/download/index.html>

        Legalize Adulthood! <http://blogs.xmission.com/legalize/>


More information about the Magick-bugs mailing list