Update for giflib to 6.1.3.

https://sourceforge.net/p/giflib/code/ci/edff4aed17f857442ab0cac31566572ba08f93d3/log/

OK and tweaks by jca@
This commit is contained in:
gonzalo
2026-05-26 07:24:28 +00:00
parent b3f6ae822e
commit fc480a9fd3
7 changed files with 39 additions and 130 deletions
+4 -4
View File
@@ -1,8 +1,7 @@
COMMENT= tools and library routines for working with GIF images
DISTNAME= giflib-5.2.2
REVISION= 0
SHARED_LIBS += gif 9.1 # 7.1
DISTNAME= giflib-6.1.3
SHARED_LIBS += gif 10.0
CATEGORIES= graphics
SITES= ${SITE_SOURCEFORGE:=giflib/}
@@ -17,7 +16,8 @@ WANTLIB += c m
USE_GMAKE= Yes
CFLAGS+= -DHAVE_REALLOCARRAY
MAKE_FLAGS= CC="${CC}" OFLAGS="${CFLAGS}" LIBVER="${LIBgif_VERSION}"
FAKE_FLAGS= MANDIR="${PREFIX}/man" LIBVER="${LIBgif_VERSION}"
FAKE_FLAGS= MANDIR="${PREFIX}/man" LIBVER="${LIBgif_VERSION}" \
PREFIX="${PREFIX}"
BUILD_DEPENDS+= textproc/xmlto
TEST_DEPENDS= sysutils/coreutils
+2 -2
View File
@@ -1,2 +1,2 @@
SHA256 (giflib-5.2.2.tar.gz) = vn/70FfK3r4qoURUL9kMaDjGoIO16KkEi47jtmsp1fs=
SIZE (giflib-5.2.2.tar.gz) = 447175
SHA256 (giflib-6.1.3.tar.gz) = tltmuZ8EJLk1JfmHOG8i/F77naK/ySrUpTIkmq/7qw4=
SIZE (giflib-6.1.3.tar.gz) = 470579
+25 -73
View File
@@ -1,96 +1,48 @@
- Correct document page install.
61f375082c80ee479eb8ff03189aea691a6a06aa
hunk 1, disable -Wno-format-truncation, not available on some compilers?
hunk 2, move quantize.c back to exported library, it was in the public
API prior to 5.2 and is used by various downstream users
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=935088
https://src.fedoraproject.org/rpms/giflib/c/109bf038d703a471b857aba44af673be103d7079?branch=master
hunk 5-6, library handling
Index: Makefile
--- Makefile.orig
+++ Makefile
@@ -8,7 +8,7 @@
#
OFLAGS = -O0 -g
OFLAGS = -O2
-CFLAGS = -std=gnu99 -fPIC -Wall -Wno-format-truncation $(OFLAGS)
+CFLAGS = -std=gnu99 -fPIC -Wall $(OFLAGS)
SHELL = /bin/sh
TAR = tar
@@ -29,11 +29,11 @@ LIBPOINT=0
LIBVER=$(LIBMAJOR).$(LIBMINOR).$(LIBPOINT)
SOURCES = dgif_lib.c egif_lib.c gifalloc.c gif_err.c gif_font.c \
- gif_hash.c openbsd-reallocarray.c
+ gif_hash.c openbsd-reallocarray.c quantize.c
HEADERS = gif_hash.h gif_lib.h gif_lib_private.h
OBJECTS = $(SOURCES:.c=.o)
-USOURCES = qprintf.c quantize.c getarg.c
+USOURCES = qprintf.c getarg.c
UHEADERS = getarg.h
UOBJECTS = $(USOURCES:.c=.o)
@@ -63,17 +63,21 @@ UTILS = $(INSTALLABLE) \
LDLIBS=libgif.a -lm
-MANUAL_PAGES = \
+MANUAL_PAGES_1 = \
doc/gif2rgb.xml \
doc/gifbuild.xml \
doc/gifclrmp.xml \
doc/giffix.xml \
- doc/giflib.xml \
doc/giftext.xml \
doc/giftool.xml
+MANUAL_PAGES_7 = \
+ doc/giflib.xml
+
+MANUAL_PAGES = $(MANUAL_PAGES_1) $(MANUAL_PAGES_7)
+
SOEXTENSION = so
-LIBGIFSO = libgif.$(SOEXTENSION)
+LIBGIFSO = libgif.$(SOEXTENSION).$(LIBVER)
@@ -95,7 +95,7 @@ SOEXTENSION = so
LIBGIFSO = libgif.$(SOEXTENSION)
LIBGIFSOMAJOR = libgif.$(SOEXTENSION).$(LIBMAJOR)
LIBGIFSOVER = libgif.$(SOEXTENSION).$(LIBVER)
LIBUTILSO = libutil.$(SOEXTENSION)
@@ -99,7 +103,7 @@ $(LIBGIFSO): $(OBJECTS) $(HEADERS)
-LIBUTILSO = libutil.$(SOEXTENSION)
+LIBUTILSO = libutil.$(SOEXTENSION).$(LIBVER)
LIBUTILSOMAJOR = libutil.$(SOEXTENSION).$(LIBMAJOR)
ifeq ($(UNAME), Darwin)
SOEXTENSION = dylib
@@ -125,7 +125,7 @@ $(LIBGIFSO): $(OBJECTS) $(HEADERS)
ifeq ($(UNAME), Darwin)
$(CC) $(CFLAGS) -dynamiclib -current_version $(LIBVER) $(OBJECTS) -o $(LIBGIFSO)
else
- $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBGIFSOMAJOR) -o $(LIBGIFSO) $(OBJECTS)
- $(CC) $(CFLAGS) $(CPPFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBGIFSOMAJOR) -o $(LIBGIFSO) $(OBJECTS)
+ $(CC) $(CFLAGS) -shared $(LDFLAGS) -o $(LIBGIFSO) $(OBJECTS)
endif
libgif.a: $(OBJECTS) $(HEADERS)
@@ -109,7 +113,7 @@ $(LIBUTILSO): $(UOBJECTS) $(UHEADERS)
@@ -135,7 +135,7 @@ $(LIBUTILSO): $(UOBJECTS) $(UHEADERS)
ifeq ($(UNAME), Darwin)
$(CC) $(CFLAGS) -dynamiclib -current_version $(LIBVER) $(OBJECTS) -o $(LIBUTILSO)
$(CC) $(CFLAGS) -dynamiclib -current_version $(LIBVER) $(UOBJECTS) -o $(LIBUTILSO)
else
- $(CC) $(CFLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBUTILMAJOR) -o $(LIBUTILSO) $(UOBJECTS)
- $(CC) $(CFLAGS) $(CPPLAGS) -shared $(LDFLAGS) -Wl,-soname -Wl,$(LIBUTILSOMAJOR) -o $(LIBUTILSO) $(UOBJECTS)
+ $(CC) $(CFLAGS) -shared $(LDFLAGS) -o $(LIBUTILSO) $(UOBJECTS)
endif
libutil.a: $(UOBJECTS) $(UHEADERS)
@@ -145,11 +149,10 @@ install-lib:
@@ -169,7 +169,7 @@ spellcheck:
ifeq ($(UNAME), Darwin)
install: all install-bin install-include install-lib
else
-install: all install-bin install-include install-lib install-man install-doc
+install: all install-bin install-include install-lib install-man
endif
install-bin: $(INSTALLABLE)
@@ -184,8 +184,6 @@ install-static-lib:
install-shared-lib:
$(INSTALL) -d "$(DESTDIR)$(LIBDIR)"
$(INSTALL) -m 644 libgif.a "$(DESTDIR)$(LIBDIR)/libgif.a"
$(INSTALL) -m 755 $(LIBGIFSO) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSOVER)"
- ln -sf $(LIBGIFSOVER) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSOMAJOR)"
- ln -sf $(LIBGIFSOMAJOR) "$(DESTDIR)$(LIBDIR)/$(LIBGIFSO)"
install-lib: install-static-lib install-shared-lib
install-man:
- $(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1"
- $(INSTALL) -m 644 $(MANUAL_PAGES) "$(DESTDIR)$(MANDIR)/man1"
+ $(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(MANDIR)/man7"
+ $(INSTALL) -m 644 $(MANUAL_PAGES_1:xml=1) "$(DESTDIR)$(MANDIR)/man1"
+ $(INSTALL) -m 644 $(MANUAL_PAGES_7:xml=7) "$(DESTDIR)$(MANDIR)/man7"
uninstall: uninstall-man uninstall-include uninstall-lib uninstall-bin
uninstall-bin:
cd "$(DESTDIR)$(BINDIR)" && rm -f $(INSTALLABLE)
$(INSTALL) -d "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(MANDIR)/man7"
@@ -1,14 +0,0 @@
Disable calling a target which wants ImageMagick.
Index: doc/Makefile
--- doc/Makefile.orig
+++ doc/Makefile
@@ -46,7 +46,7 @@ giflib-logo.gif: ../pic/gifgrid.gif
convert $^ -resize 50x50 $@
# Philosophical choice: the website gets the internal manual pages
-allhtml: $(XMLALL:.xml=.html) giflib-logo.gif
+allhtml: $(XMLALL:.xml=.html)
manpages: $(XMLMAN1:.xml=.1) $(XMLMAN7:.xml=.7) $(XMLINTERNAL:.xml=.1)
-18
View File
@@ -1,18 +0,0 @@
Fix CVE-2025-31344
https://www.openwall.com/lists/oss-security/2025/04/07/3
Index: gif2rgb.c
--- gif2rgb.c.orig
+++ gif2rgb.c
@@ -329,6 +329,11 @@ static void DumpScreen2RGB(char *FileName, int OneFile
GifRow = ScreenBuffer[i];
GifQprintf("\b\b\b\b%-4d", ScreenHeight - i);
for (j = 0; j < ScreenWidth; j++) {
+ /* Check if color is within color palete */
+ if (GifRow[j] >= ColorMap->ColorCount) {
+ GIF_EXIT(GifErrorString(
+ D_GIF_ERR_IMAGE_DEFECT));
+ }
ColorMapEntry = &ColorMap->Colors[GifRow[j]];
Buffers[0][j] = ColorMapEntry->Red;
Buffers[1][j] = ColorMapEntry->Green;
+8 -17
View File
@@ -1,39 +1,30 @@
#1, gmake-ism
#2, unsure if this is a test bug or a command-line parser bug, but the -p
value isn't read in the original order; same on Linux
#3, "head --bytes=-20" means "display most of the file, but trim last 20 bytes"
which isn't easily replicable with base tools, so just use ghead from coreutils
Index: tests/makefile
--- tests/makefile.orig
+++ tests/makefile
@@ -27,12 +27,12 @@ rebuild: render-rebuild \
UTILS = ..
PICS = ../pic
@@ -39,12 +39,12 @@ GIF2RGB = ../gif2rgb
$(GIF2RGB):
@$(MAKE) -C .. gif2rgb
-GIFS := $(shell ls ../pic/*.gif)
+GIFS := `ls ../pic/*.gif`
# Test decompression and rendering by unpacking images,
# converting them to RGB, and comparing that result to a check file.
render-regress:
render-regress: $(GIF2RGB)
- @for test in $(GIFS); \
+ for test in $(GIFS); \
do \
stem=`basename $${test} | sed -e "s/.gif$$//"`; \
if echo "Testing RGB rendering of $${test}" >&2; \
@@ -104,10 +104,10 @@ giffilter-regress:
$(UTILS)/gif2rgb -1 <$${test} | ./cmpdiffer "gif2rgb: test of $${test}" $${stem}.rgb; \
@@ -106,9 +106,9 @@ giffilter-regress: $(GIF2RGB)
giffix-rebuild:
@echo "Rebuilding giffix test."
- @head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d >giffixed.ico
+ @ghead --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d >giffixed.ico
giffix-regress:
@echo "giffix: Testing giffix behavior"
- @head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d | diff -u giffixed.ico -
- @head --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d | ./tapdiffer "giffix: Testing giffix behavior" giffixed.ico
+ @ghead --bytes=-20 <$(PICS)/treescap.gif | $(UTILS)/giffix 2>/dev/null | $(UTILS)/gifbuild -d | diff -u giffixed.ico -
gifinto-regress:
@echo "gifinto: Checking behavior on short files."
@rm -f $@.giflib.tmp
-2
View File
@@ -1,6 +1,5 @@
@conflict libungif-*
@pkgpath graphics/libungif
@bin bin/gif2rgb
@bin bin/gifbuild
@bin bin/gifclrmp
@bin bin/giffix
@@ -9,7 +8,6 @@
include/gif_lib.h
@static-lib lib/libgif.a
@lib lib/libgif.so.${LIBgif_VERSION}
@man man/man1/gif2rgb.1
@man man/man1/gifbuild.1
@man man/man1/gifclrmp.1
@man man/man1/giffix.1