changeset 59271:fe5e931830e5

8230597: Update GIFlib library to the 5.2.1 Reviewed-by: prr, psadhukhan, jdv
author serb
date Mon, 02 Dec 2019 16:38:34 -0800
parents f051fadd0d06
children 8081bf6f4309
files src/java.desktop/share/legal/giflib.md src/java.desktop/share/native/libsplashscreen/giflib/dgif_lib.c src/java.desktop/share/native/libsplashscreen/giflib/gif_err.c src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h src/java.desktop/share/native/libsplashscreen/giflib/gifalloc.c src/java.desktop/share/native/libsplashscreen/giflib/openbsd-reallocarray.c
diffstat 8 files changed, 22 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/src/java.desktop/share/legal/giflib.md	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/legal/giflib.md	Mon Dec 02 16:38:34 2019 -0800
@@ -1,9 +1,9 @@
-## GIFLIB v5.1.8
+## GIFLIB v5.2.1
 
 ### GIFLIB License
 ```
 
-The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond
+The GIFLIB distribution is Copyright (c) 1997  Eric S. Raymond
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
@@ -27,17 +27,4 @@
 https://sourceforge.net/p/giflib/code/ci/master/tree/openbsd-reallocarray.c
 
 Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
-
-Permission to use, copy, modify, and distribute this software for any
-purpose with or without fee is hereby granted, provided that the above
-copyright notice and this permission notice appear in all copies.
-
-THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-```
+SPDX-License-Identifier: MIT
--- a/src/java.desktop/share/native/libsplashscreen/giflib/dgif_lib.c	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/dgif_lib.c	Mon Dec 02 16:38:34 2019 -0800
@@ -30,22 +30,21 @@
 if you only require one of read and write capability, only one of these
 two modules will be linked.  Preserve this property!
 
+SPDX-License-Identifier: MIT
+
 *****************************************************************************/
 
 #include <stdlib.h>
 #include <limits.h>
 #include <stdint.h>
 #include <fcntl.h>
-/** Begin JDK modifications to support building on Windows **/
-#ifndef _WIN32
-#include <unistd.h>
-#endif
-/** End JDK modifications to support building on Windows **/
 #include <stdio.h>
 #include <string.h>
 
 #ifdef _WIN32
 #include <io.h>
+#else
+#include <unistd.h>
 #endif /* _WIN32 */
 
 #include "gif_lib.h"
@@ -55,8 +54,7 @@
 #define UNSIGNED_LITTLE_ENDIAN(lo, hi) ((lo) | ((hi) << 8))
 
 /* avoid extra function call in case we use fread (TVT) */
-/** JDK modification "inline" is dropped to support c89 **/
-static /**inline**/ int InternalRead(GifFileType *gif, GifByteType *buf, int len) {
+static int InternalRead(GifFileType *gif, GifByteType *buf, int len) {
     //fprintf(stderr, "### Read: %d\n", len);
     return
     (((GifFilePrivateType*)gif->Private)->Read ?
@@ -969,7 +967,7 @@
                 while (StackPtr != 0 && i < LineLen)
                     Line[i++] = Stack[--StackPtr];
             }
-            if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < LZ_MAX_CODE && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
+            if (LastCode != NO_SUCH_CODE && Private->RunningCode - 2 < (LZ_MAX_CODE+1) && Prefix[Private->RunningCode - 2] == NO_SUCH_CODE) {
                 Prefix[Private->RunningCode - 2] = LastCode;
 
                 if (CrntCode == Private->RunningCode - 2) {
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_err.c	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_err.c	Mon Dec 02 16:38:34 2019 -0800
@@ -26,6 +26,8 @@
 
 gif_err.c - handle error reporting for the GIF library.
 
+SPDX-License-Identifier: MIT
+
 ****************************************************************************/
 
 #include <stdio.h>
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_hash.h	Mon Dec 02 16:38:34 2019 -0800
@@ -26,6 +26,8 @@
 
 gif_hash.h - magfic constants and declarations for GIF LZW
 
+SPDX-License-Identifier: MIT
+
 ******************************************************************************/
 
 #ifndef _GIF_HASH_H_
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib.h	Mon Dec 02 16:38:34 2019 -0800
@@ -26,6 +26,8 @@
 
 gif_lib.h - service library for decoding and encoding GIF images
 
+SPDX-License-Identifier: MIT
+
 *****************************************************************************/
 
 #ifndef _GIF_LIB_H_
@@ -36,8 +38,8 @@
 #endif /* __cplusplus */
 
 #define GIFLIB_MAJOR 5
-#define GIFLIB_MINOR 1
-#define GIFLIB_RELEASE 8
+#define GIFLIB_MINOR 2
+#define GIFLIB_RELEASE 1
 
 #define GIF_ERROR   0
 #define GIF_OK      1
@@ -247,15 +249,6 @@
 
 
 /******************************************************************************
- Color table quantization (deprecated)
-******************************************************************************/
-int GifQuantizeBuffer(unsigned int Width, unsigned int Height,
-                   int *ColorMapSize, GifByteType * RedInput,
-                   GifByteType * GreenInput, GifByteType * BlueInput,
-                   GifByteType * OutputBuffer,
-                   GifColorType * OutputColorMap);
-
-/******************************************************************************
  Error handling and reporting.
 ******************************************************************************/
 extern const char *GifErrorString(int ErrorCode);     /* new in 2012 - ESR */
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gif_lib_private.h	Mon Dec 02 16:38:34 2019 -0800
@@ -26,6 +26,8 @@
 
 gif_lib_private.h - internal giflib routines and structures
 
+SPDX-License-Identifier: MIT
+
 ****************************************************************************/
 
 #ifndef _GIF_LIB_PRIVATE_H
--- a/src/java.desktop/share/native/libsplashscreen/giflib/gifalloc.c	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/gifalloc.c	Mon Dec 02 16:38:34 2019 -0800
@@ -26,6 +26,8 @@
 
  GIF construction tools
 
+SPDX-License-Identifier: MIT
+
 ****************************************************************************/
 
 #include <stdlib.h>
--- a/src/java.desktop/share/native/libsplashscreen/giflib/openbsd-reallocarray.c	Mon Dec 02 12:01:40 2019 +0530
+++ b/src/java.desktop/share/native/libsplashscreen/giflib/openbsd-reallocarray.c	Mon Dec 02 16:38:34 2019 -0800
@@ -25,18 +25,7 @@
 /*    $OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $    */
 /*
  * Copyright (c) 2008 Otto Moerbeek <otto@drijf.net>
- *
- * Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ * SPDX-License-Identifier: MIT
  */
 
 #include <sys/types.h>