9 * Fix SF bug #87 Heap buffer overflow in 5.1.2 (gif2rgb).
17 * Code hardening using reallocarray() from OpenBSD.
19 * Sanity check in giffilter catches files with malformed extension records
20 Fixes SourceForge bug #63: malformed gif causes segfault in giffilter.
22 * Inexpensive sanity check in DGifSlurp() catches malformed files with
23 no image descriptor. Fixes SourceForge bug #64: malformed gif causes
26 * Fix SourceForge bug #66: GifDrawBoxedText8x8() modifying constant input
29 * Bail out of GIF read on invalid pixel width. Addresses Savannah bug
30 #67: invalid shift in dgif_lib.c
32 * Fix SourceForge bug #69: #69 Malformed: Gif file with no extension
33 block after a GRAPHICS_EXT_FUNC_CODE extension causes segfault (in
36 * Fix SourceForge bug #71: Buffer overwrite when giffixing a malformed gif.
38 * Fix SourceForge bug #73: Null pointer deference in gifclrmap (only
39 reachable with malformed GIF).
41 * Fix SourceForge bug #74: Double free in gifsponge under 5.1,1,
42 for any valid gif image.
44 * Fix SourceForge bug #75: GAGetArgs overflows due to uncounted use of va_arg.
46 * Sanity check in giffix catches some malformed files. Addresses
47 SourceForge bug #77: dgif_lib.c: extension processing error
56 * Numerous minor fixes in getarg.c. Affects only the utilities, not the
59 * Fix SourceForge bug #59: DGifOpen can segfault if DGifGetScreenDesc fails.
61 * SourceForge patch #20: In gifalloc, fix usage of realloc() in case of failure.
63 * Fix SourceForge bug #61 Leak in gifsponge.
68 * glibtoolize port fix for OS X.
73 Changes to the API require a library major-version bump.
78 * A small change to the API: DGifClose() and EGifClose() now take a
79 pointer-to-int second argument (like the corresponding openers)
80 where a diagnostic code will be deposited when they return
81 GIF_ERROR. This replaces the old behavior in which the GifFile
82 structure was left unfreed so the Error member in it could be filled
83 and remain available. The change was was required because it's
84 not always possible to free the struct afterwards. Case in point is
85 a C# wrapper for giflib (or any language/environment where you can't
86 just free objects allocated in a foreign shared library.)
88 * Minor fix for SF bug #56; BitsPerPixel may be left as uninitialized
89 value when reading (truncated) gif.
91 * Applied SF patch #17: Use a fallback on Windows where mkstemp is not
94 * Applied SF patch #15: Code hardening, preventing spurious
95 defective-image messages.
100 * Removed gif2raw from utils. Its blithe assumption that the EGA16
101 palette is a reliable default is now about 20 years obsolete. Format
102 conversion is better done with convert(1) from the ImageMagick suite,
108 Minor fix for a rare memory leak (SF bug #55).
112 Repair the internal quantization function used in gif2rgb so it's
113 less vulnerable to cross-platform skew due to qsort() being unstable.
114 This shouldn't affect production use, it's just a cross-platform
115 issue for regression testing
120 Set the error return properly when a screen descriptor read fails.
121 Fixes for some minor API documentation bugs. Some internal manual
122 pages are not to be installed.
127 Fix for a rare misrendering bug when a GIF overruns the decompression-code
128 table. The image on which this was spotted was a relatively long-running
129 animated GIF; still images of ordinary size should have been immune.
134 Fix a build-system glitch so it will install manpages.
139 Documentation and polish
140 ------------------------
141 * Partial build is now possible on systems without xmlto.
145 * Change unused return of EGifSetGifVersion() to void.
146 * Buffer overrun prevention in gifinto.
151 Documentation and polish
152 ------------------------
153 * There is now an installable manual page for the GIFLIB utility kit.
157 * gifinter is gone. Use convert -interlace from the ImageMagic suite.
161 * In 5.0.0 the private gif89 bit wasn't being guaranteed cleared at
162 the beginning of EGifGetGifVersion(); this occasionally led to an
163 incorrect version prefix being issued dependent on the state of
165 * An EGifSetGifVersion() function taking a GifFile argument has been
166 added for use with the low-level sequential API. This change requires
167 a bump of the library revision number.
172 Changes to the API require a library major-version bump. Certain
173 initialization functions have acquired an integer address argument for
174 passing back an error code, in order to avoid thread-unsafe static
175 storage. Application code using extension blocks will require minor
176 changes. A few functions have been renamed.
180 * Fixes applied for CVE-2005-2974 and CVE-2005-3350
181 This closes Debian bug #337972.
188 The library is now completely re-entrant and thread-safe.
190 * Library error handling no longer uses a static cell to store the last
191 error code registered; that made the library thread-unsafe. For functions
192 other than GIF file openers, the code is now put in an Error member of
193 the GifFileType structure. The GifError() and GifLastError() functions
194 that referenced that static cell are gone, and the GifErrorString()
195 function introduced in the 4.2 release now takes an explicit error code
197 * GIF file openers - DGifOpenFileName(), DGifOpenFileHandle(), DGifOpen(),
198 EGifOpenFileName(), EGifOpenFileHandle(), and EGifOpen() - all now take
199 a final integer address argument. If non-null, this is used to pass
200 back an error code when the function returns NULL.
204 The ExtensionBlock API has been repaired, solving some problems with GIF89
205 extension handling in earlier versions.
207 * DGifSlurp() and EGifSpew() now preserve trailing extension blocks with
208 no following image file.
209 * Three documented functions - EGifPutExtensionFirst(), EGifPutExtensionNext(),
210 and EGifPutExtensionLast() - have been relaced by new functions
211 EGifPutExtensionLeader(), EGifPutExtensionBlock(), and
212 EGifPutExtensionTrailer(). See the Compatibility section of
213 the library API documentation for details.
214 * New functions DGifSavedExtensionToGCB() and EGifGCBToSavedExtension()
215 make it easy to read and edit GIF89 graphics control blocks in saved images.
219 All functions exported by giflib now have DGif, EGif, or Gif as a name prefix.
221 * Three documented functions - MakeMapObject(), FreeMapObject(), and
222 UnionColorMap() - have been renamed to GifMakeMapObject(),
223 GifFreeMapObject(), and GifUnionColorMap() respectively.
224 * The library Draw* functions are now prefixed GifDraw*, and the
225 text-drawing ones are suffixed with "8x8". This fixes a conflict
226 with the Windows API and leaves the door open for more general text-drawing
227 functions with different font sizes.
231 * DGifSlurp() and EGifSpew() now read and write interlaced images properly.
232 * The amazingly obscure colormap sort flag and pixel aspect ratio
233 features of GIF are now read and preserved, for whatever good that
235 * Six undocumented functions have been renamed; five of these take additional
236 or slightly different argument types. See the Compatibility section of
237 the library API documentation for details.
238 * There's now an EGifGetGifVersion() that computes the version EGifSpew()
240 * QuantizeBuffer() has been returned to the core library as GifQuantizeBuffer()
241 - turns out some important applications (notably mplayer) were using it.
242 * TRUE and FALSE macros are gone, also VoidPtr. No more namespace pollution.
243 * Various arguments have been made const where possible.
247 * The (undocumented) gifinfo utility is gone. Use giftool -f instead.
248 * The gifburst utility is gone. Everybody has image viewers that
249 can pan now, and removing it gets rid of a dependency on Perl.
250 * gifcompose is gone. It was a decent idea when I wrote it in 1989,
251 but I did the same thing better and cleaner a decade later with
252 PILdriver in the PIL package. Removing it gets rid of a dependency
254 * gif2x11 gifasm, gifcomb, gifflip, gifovly, gifpos, gifresize, and gifrotate
255 are all gone. The ImageMagick display(1)/convert(1) utilities and PILdriver
256 do these things better and in a format-independent way.
257 * Lennie Araki's Windows C++ wrapper is gone. It's eight years old,
258 unmaintained, he has dropped out of sight, and a better one needs to
259 be written to use the high-level GIFLIB API and GIF89 graphics
260 control extension support. We'll carry such a wrapper when we have
262 * EGifSetVersion(), introduced in 4.2, is gone. The library always
263 writes GIF87 or GIF89 as required by the data. This change helps
268 * Several utilities have been renamed to (a) fix last-century's habit
269 of arbitarily smashing vowels out of names to make them just one or two
270 characters shorter, (b) ensure that every utility in this set has 'gif'
271 as a name prefix. Here's the list:
273 giffiltr -> giffilter
274 gifspnge -> gifsponge
279 * To go with its new name, gif2raw now dumps raw pixels from a GIF if the
280 (previously required) size option is missing.
281 * Standalone rgb2gif is gone; the same capability is now a mode of gif2rgb.
282 * giftext displays the parsed contents of GIF89 graphics control blocks.
283 * gifbuild handles GIF89 graphics control blocks and Netscape animation
284 loop blocks; it can can display and update either.
285 * gifrotate and other filter utilities now preserve extension blocks,
286 including the graphics control information for transparency and delay time.
287 * A new utility, giftool, supports a wide variety of filtering operations
288 on GIFs, including: setting background and transparency colors, changing
289 interlacing, setting image delays, setting the user-input flag, and setting
290 the aspect-ratio byte. It can sequence multiple operations.
291 * The test-pattern generators gifbg, gifcolor, gihisto and gifwedge and the
292 code templates giffilter and gifsponge are no longer installed by default.
294 Documentation and polish
295 ------------------------
296 * The history.txt and build.txt and files from 4.2.0 now have .asc extensions
297 to indicate that they use asciidoc markup, contrasting with the txt
298 standards files from CompuServe.
299 * The documentation now includes "What's In A GIF", a very detailed narrative
300 description of the file format.
301 * The -A option of gifasm (for inserting a loop control block) is documented.
302 * The documentation directory includes a copy of the original GIF87
303 specification as well as GIF89's.
304 * The project now has a logo.
309 Now maintained by ESR again after handoff by Toshio Kuratomi.
313 * Code updated internally to C99 to enable more correctness checks by
314 the compiler. Compiles under GCC 4.6.1 without errors or warnings.
315 * A rare resource leak in the colormap-object maker was found with
317 * The code now audits clean under Coverity and cppcheck.
318 * splint cleanup begun, there's a lot of work still to do on this.
322 * The default GIF version to write is now computed at write time from
323 the types of an image's extension blocks, but can be overridden with
325 * EGifSpew() is now thread-safe.
326 * Two new functions, GifError() and GifErrorString(),
327 return the error state in a form that can be used by programs.
328 * Two library functions - EGifOpenFileName() and EGifPutImageDesc() -
329 now have bool rather than int flag arguments. Since bool is a
330 typedef of int and TRUE/FALSE have been redefined to true/false,
331 both source and object compatibility with older library versions
333 * GAGetArgs(), used only in the utilities, now returns bool rather
335 * The undocumented GIF_LIB_VERSION symbol is gone from the library header.
336 It has been replaced with three documented symbols: GIFLIB_MAJOR,
337 GIFLIB_MINOR, and GIFLIB_RELEASE.
341 * The gif2epsn and gif2iris utilities are gone. They were full of
342 platform dependencies for platforms long dead. There are enough
343 platform-independent GIF viewers in the world that these weren't
344 adding any value. Removing these gets rid of a dependency on GL.
345 * The rle2gif, gif2rle, and gif2ps utilities are also gone. There are enough
346 multiformat image converters in the world that these weren't adding
347 any value either. Removing them reduces the codebase's dependencies.
348 * The undocumented DumpScreen2Gif() is gone from the library. The
349 only non-obsolete capture mode it supported was through X, and that
350 probably hasn't been used in years and is replaceable by any number
351 of capture utilities. Dropping this code makes the library's
352 portability issues go away.
353 * QuantizeBuffer(), GifQprintf(), PrintGifError(), GIF_ERROR()
354 and GIF_MESSAGE() have been removed from the core library.
355 They were used only by the utilities. QuantizeBuffer() has been
356 inlined where it was used and the latter three are now part of the
357 utility support library.
358 * The Game Boy Advanced test code is gone. The platform was discontinued
359 in 2008; more to the point, nobody ever documented the code's assumptions
361 * The Changelog file is now retained for archival purposes only, and because
362 autotools throws a hissy fit if there isn't one. The single point of
363 truth about changes and the reasons for them is the repository history.
367 * The -q option of the utilities is replaced by an opposite -v (verbose)
368 option; the default is now quiet for all platforms. Defaulting to chattiness
369 on MSDOS made sense in a world of slow text consoles, but not today.
373 * There is now a proper regression-test suite; run 'make' in tests/.
374 The old test-unx script is now tests/visual-check and can be run
375 occasionally for a check with the Mark One Eyeball.
379 * Build instructions now live in build.txt
380 * An overview of the giflib API now lives in api.txt.
381 * Documentation is now in DocBook-XML, so either HTML or man pages can
382 be generated from it.
386 Brown paper bag release. Fix a problem with header inclusion that could
387 prevent the library from building on some platforms.
391 This version has some important fixes for segfaults when working with corrupt
392 files. All users are strongly encouraged to upgrade.
396 * Fix segfault in utilities due to referencing ColorMaps in GifFiles that had
398 * Fix gif2x11 to work on 24 bit displays.
399 * Fix for giftext segfault when the GifFile does not store a global colormap.
400 * Checks to fail gracefully when an image contains improper LZ codes.
401 * Close file handles on failure in DGifOpenFileHandle()
402 * Checks to operate on files in binary mode on WIN32 as well as MSDOS.
406 * Add checks to make building on Win32 easier.
407 * Allow turning off gl_s, rle, and X11 support from the configure command line.
408 * Fix for finding a 32 bit integer type on some platforms.
409 * Only enable -Wall if we're using gcc.
413 This version fixes some bugs with deallocating ColorMaps. Fix building on
414 several platforms. Fix x86_64 builds to not hang the encoder.
416 * Fix several areas in decoding where we removed a ColorMap from our GifFile
417 but didn't set the pointer to NULL. This could lead to double free's of
419 * Fix a bug in dev2gif.c where we redefined some gl types incorrectly.
420 * Fix a bug in the gif LZW encoder that was triggered on modern 64 bit
422 * Fix building on Windows. Note -- there has been one API changing event for
423 Windows (renaming DrawText to DrawGifText.) This should have conflicted with
424 Windows API and therefore caused the builds to fail previously. If you had
425 it working with DrawText before, apologies, you'll need to change to
426 DrawGifText in your code. This only affects Windows.
427 * Add support for building on The Game Boy Advance. Note: Due to the GBA's
428 limited memory, the API for the GBA uses short's in many places where the
429 other platforms use ints. This shouldn't affect anyone unless you've
430 been able to get an older version of the code to run on GBA and want to
431 start using this version instead. A recompile of your dependent code
432 will be necessary in this case.
436 This version fixes some bugs in the Extension writing code in
437 EGifPutExtensionFirst, Next, and Last. Using these functions, it is possible
438 to output extensions that contain multiple subblocks. Additionally, library
439 code has been updated to use these functions, making it safe to output
440 long Comments, and multi-block extensions read in from another file.
442 * giflib is now hosted on sourceforge with libungif:
443 http://sourceforge.net/projects/libungif
444 * Make the EGifPutExtension{First,Next,Last} family of functions use WRITE
445 so user defined WRITE methods will output them correctly.
446 * Modify EGifSpew and EGifPutComment to use EGifPutExtension{First,Next,Last}
447 so we won't output broken GIFs when dealing with GIFs with multiple
449 * More -Wall fixes revealed while testing on Solaris and FreeBSD.
450 * Updated the gif_lib.html documentation to not use EGifPutExtension when
451 dealing with multiple subblocks. Use EGifPutExtension{First,Next,Last}
453 * Some Windows code from the old CVS repository now available in the windows
454 subdirectory. I don't have a Windows environment to test and maintain this
455 but maybe someone out there will find it useful. Caveat hacker.
459 * Numerous bug fixes from people on the old libungif mailing list.
460 * GIF_ERROR and GIF_MESSAGE are on the deprecation list as they are also
461 utility helper functions rather than essential to the functioning of the
463 * Complete deprecation list is now in the README file
464 * Audited the sources with gcc -Wall. Everything detectable has now been fixed.
465 * Ran the library code through indent.
469 * Merge in many bug fixes that were sent in while I was hiking the
471 * The qprintf methods of the library are now deprecated. Do not use
472 GifQuietPrint or GifQprintf. These should have been pushed out into the
473 utility helper library instead of sitting around in the library proper at
474 the same time as the getarg functions were moved out. Getting rid of these
475 will let us get rid of our dependence on stdarg.h/varargs.h (Which a Gif
476 reading library has no business requiring.)
480 * Several minor memory leaks in error conditions have been plugged.
481 * New Function EGifOpen(void *userData, OutputFunc writeFunc) allows user
482 specified gif writing functions.
483 * Old copyright notices in a few source files have been updated. All library
484 copyrights should now reflect the copyright notice in the COPYING file.
486 Version 4.0.0 -- giflib
487 =======================
488 This version of the giflib library merges Eric Raymond's giflib-3.0 release
489 with the libungif-4.0 release to give people a binary compatible choice
490 between the two libraries and gives me the chance to add bugfixes to giflib
491 that have been incorporated in libungif.
493 PLEASE READ THE FILE PATENT_PROBLEMS BEFORE USING THIS LIBRARY!
497 Major fixes have been made to the code that handles Extensions.
498 Unfortunately, this causes binary incompatibility with giflib-3.0 and
499 libungif-3.x. However, the API is still intact. I am, however, deprecating
500 the use of saveImage[x].Function. Use
501 saveImage[x].ExtensionBlocks[y].Function instead.
505 The following bugs which caused SegFaults have been fixed:
506 * When reading gif files with extensions, DGifSlurp would violate memory.
507 * When closing a gif that had a local colormap, DGifCloseFile would attempt
508 to free the colormap twice.
509 * Fix a potential memory leak in DGifSlurp.
510 * New function DGifOpen to allow specifying a user definable gif reading
515 * Add a new function:
516 GifFileType *DGifOpen(void * userData, InputFunc readFunc)
517 to read the gif image from a user defined input function.
523 Changes from Eric Raymond's libgif
524 ----------------------------------
525 * A new gif encoder that makes uncompressed gifs rather than standard,
526 LZW-compressed gifs. This is actually the major motivating factor behind
527 libungif; to provide third-party distributors a means to provide a gif
528 library without the patented LZW encoder.
529 * A new configure script to make compilation of the library on multiple
530 platforms easier. The package should now build shared libraries on all
531 platforms supported by GNU libtool.
532 * Removed the getarg functions from libgif. These were not part of the
533 public API and only used by the tools in the utils directory so I separated
534 them from the rest of the library.
535 * Fixed a few bugs in the tools in the utils directory.
542 * Incorporated Sirtaj Kang's changes to make both static and shared libs.
543 * All the utility and library docs are HTML now.
544 * The library and relevant utilities are now fully GIF89-aware.
545 * Functions for drawing text and boxes on saved images are documented.
546 * The distribution is now issued under a simple X-Consortium-style license.
547 * Can now generate package RPMs and LSM automatically.
548 * Home page with Web-acessible documentation at http://www.ccil.org/~esr/giflib
552 * Fix giftext to not core dump on a null extension record.
553 * Incorporate Philip VanBaren's change to prevent a core dump in gifasm.
557 * Fixed a core-dump bug in gifcomb revealed by ELF environment in Linux 1.2.13.
561 * Added gifburst tool.
565 * Linux is supported.
569 * Added the gifovly tool, which supports making a composite from several GIF
571 * Used gifovly to implement a full-fledged pasteup program in shell. It's
572 called gifcompose and lives in the util directory.
573 * Added a copy of the GIF89 standard to the doc directory (gif89.txt);
574 also a description of the preferred compression method (lzgif.txt).
578 With this version, development was taken over from Gershon Elber by Eric
579 S. Raymond <esr@snark.thyrsus.com>. Note that I, esr, have pretty much
580 adhered to Gershon's coding style, even though it's quite baroque and DOS-
581 headed by my standards.
585 * New DGifSlurp() and EGifSpew() library entry points allow all GIF-bashing
586 to be done in core on machines with sufficient memory. Writing code to
587 slice'n'dice multiple GIFs in non-sequential ways is now much easier (send
588 kudos and brickbats to esr, small unmarked bills preferred).
589 * The interface has changed somewhat. Members in the GifFileType structure
590 have been renamed and regrouped. This was required for support of the
591 SavedImages member (which enables the new functions mentioned in 1). Also,
592 there is a new data type for allocated color maps and routines to handle
594 * Some minor bugs have been fixed. Most notably, the DGif code now correctly
595 handles the possibility of more than one code block per extension record,
596 as per the GIF spec. It's not clear, however, that anyone ever has or
597 ever will use this feature for anything...
599 New Tools and Options
600 ---------------------
601 * A brand new, ultra-spiffy tool `icon2gif' is included. It assembles named
602 GIFs with editable text color map & icon raster representations to produce
603 multi-image GIFs usable as graphical resource files. It can also dump most
604 GIFs in the same text-only form it parses. This makes it easy to edit GIFs
605 even if you don't have a graphics editor.
606 * The gifclip utility supports a new `-c' (complement) option that allows you
607 to perform an `inverse clip', removing horizontal or vertical bands from an
609 * The gifclrmp utility supports a new `-t' switch for shuffling color index
611 * A new tool `gifcolor' generates test pattern from colormap input.
613 New Documentation and Examples
614 ------------------------------
615 * The documentation has been overhauled completely and translated out of the
616 dialect spoken by the estimable Mr. Elber into something like standard
618 * Two source code files gifspnge.c and giffiltr.c have been added to the
619 util directory. These are GIF copiers that exercise the I/O routines,
620 provided as skeletons for your applications. Read the comments in them
622 * The util Makefile for UNIX has been improved. It now uses the cc/gcc -s
623 option rather than strip(1). There are now separate install productions,
624 so you can test new versions in util before installation for production
625 (the top-level make script still does an install).
629 * GIFFIX - a new tool to attempt and fix broken GIF images. Currently fix
630 images that has EOF prematurely by padding with the darkest color.
631 * Make GIF2BGI display as much as it can considering the mem. avail.
632 * Add -q flag to all tools for quite running scan line number mode.
633 * Fix a (minor!?) bug in the GIF decoder when encountering code 4095.
634 * New tools (RGB2GIF and GIF2RGB) to convert GIF to/from 24 bits RGB images.
635 * New tool GIFROTAT to rotate a gif image by an arbitrary angle.
636 * GifRSize was updated to resize by an arbitrary factor.
640 * GIF2BGI - a new utility to display GIF images using Borland's BGI drivers
642 * TEXT2GIF - Converts plain text into GIF images.
643 * GIF2IRIS - SGI4D display program for GIF images.
644 * GIF_LIB naming convension has been modified to make sure it has unique
645 names (see gif_lib.h).
646 * Support for SGI4D gl and X11 window grabbing has been added to the
647 library. SGI4D input is quantizied into 8 bits.
648 Also support for EGA/VGA devices has been added as well.
649 see Dev2gif.c module.
650 * Support for the new gif89a format has been added.