403Webshell
Server IP : 82.208.35.60  /  Your IP : 216.73.216.89
Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31
System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64
User : studiokobylisy_cz ( 1008)
PHP Version : 7.3.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /usr/ports/misc/magicpoint/files/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/ports/misc/magicpoint/files/patch-gif.c
--- image/gif.c.orig	2000-03-07 06:59:56 UTC
+++ image/gif.c
@@ -15,10 +15,31 @@
 
 #ifdef USE_GIF
 
+#include <stdlib.h>
 #include "image.h"
 #include <gif_lib.h>
 
 static void
+#if GIFLIB_MAJOR >= 5
+localPrintGifError(int ErrorCode)
+#else
+localPrintGifError(void)
+#endif
+{
+#if GIFLIB_MAJOR >= 5
+    char *Err = GifErrorString(ErrorCode);
+#else
+    char *Err = GifErrorString();
+    int ErrorCode = GifError();
+#endif
+
+    if (Err != NULL)
+        fprintf(stderr, "\nGIF-LIB error: %s.\n", Err);
+    else
+        fprintf(stderr, "\nGIF-LIB undefined error %d.\n", ErrorCode);
+}
+
+static void
 tellAboutImage(name, gifp)
 	char *name;
 	GifFileType *gifp;
@@ -50,7 +71,11 @@ gifLoad(fullname, name, verbose)
 	ColorMapObject *ColorMap;
 	GifColorType *ColorMapEntry;
 
+#if GIFLIB_MAJOR >= 5
+	GifFile = DGifOpenFileName(fullname, NULL);
+#else
 	GifFile = DGifOpenFileName(fullname);
+#endif
 	if (GifFile == NULL)
 		return NULL;
 
@@ -87,13 +112,21 @@ gifLoad(fullname, name, verbose)
 	/* Scan the content of the GIF file and load the image(s) in: */
 	do {
 		if (DGifGetRecordType(GifFile, &RecordType) == GIF_ERROR) {
-			PrintGifError();
+#if GIFLIB_MAJOR >= 5
+			localPrintGifError(GifFile->Error);
+#else
+			localPrintGifError();
+#endif
 			exit(-1);
 		}
 		switch (RecordType) {
 		case IMAGE_DESC_RECORD_TYPE:
 			if (DGifGetImageDesc(GifFile) == GIF_ERROR) {
-				PrintGifError();
+#if GIFLIB_MAJOR >= 5
+				localPrintGifError(GifFile->Error);
+#else
+				localPrintGifError();
+#endif
 				exit(-1);
 			}
 			Row = GifFile->Image.Top; /* Image Position relative to Screen. */
@@ -113,7 +146,11 @@ gifLoad(fullname, name, verbose)
 							     j += InterlacedJumps[i]) {
 					if (DGifGetLine(GifFile, &ScreenBuffer[j][Col],
 					    Width) == GIF_ERROR) {
-					    PrintGifError();
+#if GIFLIB_MAJOR >= 5
+					    localPrintGifError(GifFile->Error);
+#else
+					    localPrintGifError();
+#endif
 					    exit(-1);
 					}
 				}
@@ -122,7 +159,11 @@ gifLoad(fullname, name, verbose)
 				for (i = 0; i < Height; i++) {
 					if (DGifGetLine(GifFile, &ScreenBuffer[Row++][Col],
 					    Width) == GIF_ERROR) {
-						PrintGifError();
+#if GIFLIB_MAJOR >= 5
+						localPrintGifError(GifFile->Error);
+#else
+						localPrintGifError();
+#endif
 						exit(-1);
 					}
 				}
@@ -131,7 +172,11 @@ gifLoad(fullname, name, verbose)
 		case EXTENSION_RECORD_TYPE:
 			/* Skip any extension blocks in file: */
 			if (DGifGetExtension(GifFile, &ExtCode, &Extension) == GIF_ERROR) {
-				PrintGifError();
+#if GIFLIB_MAJOR >= 5
+				localPrintGifError(GifFile->Error);
+#else
+				localPrintGifError();
+#endif
 				exit(-1);
 			}
 			/* very adhoc transparency support */
@@ -141,7 +186,11 @@ gifLoad(fullname, name, verbose)
 			}
 			while (Extension != NULL) {
 				if (DGifGetExtensionNext(GifFile, &Extension) == GIF_ERROR) {
-					PrintGifError();
+#if GIFLIB_MAJOR >= 5
+					localPrintGifError(GifFile->Error);
+#else
+					localPrintGifError();
+#endif
 					exit(-1);
 				}
 			}
@@ -179,8 +228,16 @@ gifLoad(fullname, name, verbose)
 			pixline[x] = GifRow[x];
 	}
 
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
+	if (DGifCloseFile(GifFile, NULL) == GIF_ERROR) {
+#else
 	if (DGifCloseFile(GifFile) == GIF_ERROR) {
-		PrintGifError();
+#endif
+#if GIFLIB_MAJOR >= 5
+		localPrintGifError(GifFile->Error);
+#else
+		localPrintGifError();
+#endif
 		exit(-1);
 	}
 
@@ -196,11 +253,19 @@ gifIdent(fullname, name)
 	GifFileType *gifp;
 	int ret;
 
+#if GIFLIB_MAJOR >= 5
+	gifp = DGifOpenFileName(fullname, NULL);
+#else
 	gifp = DGifOpenFileName(fullname);
+#endif
 	if (gifp == NULL)
 		ret = 0;
 	else {
+#if GIFLIB_MAJOR == 5 && GIFLIB_MINOR >= 1 || GIFLIB_MAJOR > 5
+		DGifCloseFile(gifp, NULL);
+#else
 		DGifCloseFile(gifp);
+#endif
 		tellAboutImage(name);
 		ret = 1;
 	}

Youez - 2016 - github.com/yon3zu
LinuXploit