diff src/dgif_lib.c @ 70:131b0175ea99 r20-0b30

Import from CVS: tag r20-0b30
author cvs
date Mon, 13 Aug 2007 09:02:59 +0200
parents c53a95d3c46d
children 54cc21c15cbb
line wrap: on
line diff
--- a/src/dgif_lib.c	Mon Aug 13 09:00:04 2007 +0200
+++ b/src/dgif_lib.c	Mon Aug 13 09:02:59 2007 +0200
@@ -12,18 +12,6 @@
 *  3 Sep 90 - Version 1.1 by Gershon Elber (Support for Gif89, Unique names). *
 ******************************************************************************/
 
-#ifdef emacs
-#include <config.h>
-void *xmalloc (unsigned int size);
-void *xrealloc (void *ptr, unsigned int size);
-#ifdef ERROR_CHECK_MALLOC
-void *xfree_1 (void *);
-#define xfree xfree_1
-#else
-void *xfree (void *);
-#endif
-#endif /* emacs */
-
 #ifdef __MSDOS__
 #include <io.h>
 #include <alloc.h>
@@ -38,6 +26,18 @@
 #include <stdio.h>
 #include <string.h>
 
+#ifdef emacs
+#include <config.h>
+void *xmalloc (unsigned int size);
+void *xrealloc (void *ptr, unsigned int size);
+#ifdef ERROR_CHECK_MALLOC
+void *xfree_1 (void *);
+#define xfree xfree_1
+#else
+void *xfree (void *);
+#endif
+#endif
+
 #include "gif_lib.h"
 #ifndef emacs
 #include "gif_hash.h"
@@ -915,7 +915,6 @@
     SavedImage *sp;
     ExtensionBlock *ep;
     GifByteType *ExtData;
-    int ExtCode;
 
     /* Some versions of malloc dislike 0-length requests */
     GifFile->SavedImages = (SavedImage *)xmalloc(sizeof(SavedImage));
@@ -942,12 +941,7 @@
 		break;
 
 	    case EXTENSION_RECORD_TYPE:
-	        /* This code fails if no image_desc record has been read
-		   yet.  I don't know if that's legal, but I've seen GIFs
-		   that start with an extension record.  XEmacs doesn't use
-		   the extension records anyway, so we'll just ignore them.
-		   - dkindred@cs.cmu.edu */
-#if 0
+
 		if (DGifGetExtension(GifFile,&sp->Function,&ExtData)==GIF_ERROR)
 		    return(GIF_ERROR);
 		else
@@ -971,17 +965,6 @@
 			memcpy(ep->Bytes,ExtData,ep->ByteCount * sizeof(char));
 		    }
 		}
-#else
-	        /* Skip any extension blocks in the file. */
-	        if (DGifGetExtension (GifFile, &ExtCode, &ExtData) 
-		    == GIF_ERROR)
-		    return GIF_ERROR;
-
-		while (ExtData != NULL) {
-		    if (DGifGetExtensionNext (GifFile, &ExtData) == GIF_ERROR)
-		        return GIF_ERROR;
-		}
-#endif
 		break;
 
 	    case TERMINATE_RECORD_TYPE: