diff --git a/giflib.spec b/giflib.spec index f66cbd57c3b7bad7d628a8bcf6154466f67c84e0..73ff89f1d5babd6f24a227fa4e2a337c4cfeb277 100644 --- a/giflib.spec +++ b/giflib.spec @@ -2,12 +2,19 @@ Name: giflib Version: 5.2.1 -Release: 1 +Release: 2 Summary: A library and utilities for processing GIFs License: MIT URL: http://www.sourceforge.net/projects/giflib/ Source: http://downloads.sourceforge.net/giflib/giflib-%{version}.tar.gz +# Move quantize.c back into libgif.so (#1750122) +Patch0:giflib_quantize.patch +# Fix several defects found by Coverity scan +Patch1:giflib_coverity.patch +# Generate HTML docs with consistent section IDs to avoid multilib difference +Patch2:giflib_html-docs-consistent-ids.patch + BuildRequires: make xmlto gcc provides: giflib-utils @@ -56,6 +63,9 @@ rm -f %{buildroot}/debugsourcefiles.list %{_mandir}/man1/gif*.1* %changelog +* Wed Jul 29 2020 hanhui - 5.2.1-2 +- add bugfix + * Thu Jul 23 2020 hanhui - 5.2.1-1 - update to 5.2.1 diff --git a/giflib_coverity.patch b/giflib_coverity.patch new file mode 100644 index 0000000000000000000000000000000000000000..c51234fe5f861e6c9a50f341dc73777e542b837e --- /dev/null +++ b/giflib_coverity.patch @@ -0,0 +1,43 @@ +diff -rupN --no-dereference giflib-5.2.1/gif2rgb.c giflib-5.2.1-new/gif2rgb.c +--- giflib-5.2.1/gif2rgb.c 2019-06-24 09:24:27.000000000 +0200 ++++ giflib-5.2.1-new/gif2rgb.c 2020-02-17 16:51:04.468397502 +0100 +@@ -170,6 +170,8 @@ static void SaveGif(GifByteType *OutputB + /* Open stdout for the output file: */ + if ((GifFile = EGifOpenFileHandle(1, &Error)) == NULL) { + PrintGifError(Error); ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); + } + +@@ -179,6 +181,8 @@ static void SaveGif(GifByteType *OutputB + EGifPutImageDesc(GifFile, + 0, 0, Width, Height, false, NULL) == GIF_ERROR) { + PrintGifError(Error); ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); + } + +@@ -187,8 +191,11 @@ static void SaveGif(GifByteType *OutputB + GifFile->Image.Width, GifFile->Image.Height); + + for (i = 0; i < Height; i++) { +- if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR) ++ if (EGifPutLine(GifFile, Ptr, Width) == GIF_ERROR) { ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); ++ } + GifQprintf("\b\b\b\b%-4d", Height - i - 1); + + Ptr += Width; +@@ -196,6 +203,8 @@ static void SaveGif(GifByteType *OutputB + + if (EGifCloseFile(GifFile, &Error) == GIF_ERROR) { + PrintGifError(Error); ++ free(OutputBuffer); ++ GifFreeMapObject(OutputColorMap); + exit(EXIT_FAILURE); + } + } diff --git a/giflib_html-docs-consistent-ids.patch b/giflib_html-docs-consistent-ids.patch new file mode 100644 index 0000000000000000000000000000000000000000..d4006ea72799dc1a30255956e8b4d9a3dfc6de7a --- /dev/null +++ b/giflib_html-docs-consistent-ids.patch @@ -0,0 +1,12 @@ +diff -rupN --no-dereference giflib-5.2.1/doc/Makefile giflib-5.2.1-new/doc/Makefile +--- giflib-5.2.1/doc/Makefile 2019-03-28 18:05:25.000000000 +0100 ++++ giflib-5.2.1-new/doc/Makefile 2020-02-17 16:51:04.489397582 +0100 +@@ -1,7 +1,7 @@ + .SUFFIXES: .xml .html .txt .adoc .1 + + .xml.html: +- xmlto xhtml-nochunks $< ++ xmlto --stringparam generate.consistent.ids=1 xhtml-nochunks $< + + .xml.1: + xmlto man $< diff --git a/giflib_quantize.patch b/giflib_quantize.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa34629477705fd9df2f495514d91260fbf710c1 --- /dev/null +++ b/giflib_quantize.patch @@ -0,0 +1,17 @@ +diff -rupN --no-dereference giflib-5.2.1/Makefile giflib-5.2.1-new/Makefile +--- giflib-5.2.1/Makefile 2019-06-24 18:08:57.000000000 +0200 ++++ giflib-5.2.1-new/Makefile 2020-02-17 16:51:04.450397434 +0100 +@@ -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) +