comparison src/dgif_lib.c @ 175:2d532a89d707 r20-3b14

Import from CVS: tag r20-3b14
author cvs
date Mon, 13 Aug 2007 09:50:14 +0200
parents e292c9648bb9
children 3d6bfa290dbd
comparison
equal deleted inserted replaced
174:bb3568571b84 175:2d532a89d707
920 int i, j, Error; 920 int i, j, Error;
921 #endif /* 0 */ 921 #endif /* 0 */
922 int ImageSize; 922 int ImageSize;
923 GifRecordType RecordType; 923 GifRecordType RecordType;
924 SavedImage *sp; 924 SavedImage *sp;
925 ExtensionBlock *ep;
926 GifByteType *ExtData; 925 GifByteType *ExtData;
927 int ExtCode; 926 int ExtCode;
928 927
929 /* Some versions of malloc dislike 0-length requests */ 928 /* Some versions of malloc dislike 0-length requests */
930 GifFile->SavedImages = (SavedImage *)xmalloc(sizeof(SavedImage)); 929 GifFile->SavedImages = (SavedImage *)xmalloc(sizeof(SavedImage));
959 #if 0 958 #if 0
960 if (DGifGetExtension(GifFile,&sp->Function,&ExtData)==GIF_ERROR) 959 if (DGifGetExtension(GifFile,&sp->Function,&ExtData)==GIF_ERROR)
961 return(GIF_ERROR); 960 return(GIF_ERROR);
962 else 961 else
963 { 962 {
964 ep = &sp->ExtensionBlocks[sp->ExtensionBlockCount++]; 963 ExtensionBlock *ep =
964 &sp->ExtensionBlocks[sp->ExtensionBlockCount++];
965 965
966 ep->ByteCount = ExtData[0]; 966 ep->ByteCount = ExtData[0];
967 ep->Bytes = (GifByteType *)xmalloc(ep->ByteCount * sizeof(GifByteType)); 967 ep->Bytes = (GifByteType *)xmalloc(ep->ByteCount * sizeof(GifByteType));
968 memcpy(ep->Bytes, ExtData, ep->ByteCount * sizeof(char)); 968 memcpy(ep->Bytes, ExtData, ep->ByteCount * sizeof(char));
969 } 969 }
971 while (ExtData != NULL) { 971 while (ExtData != NULL) {
972 if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR) 972 if (DGifGetExtensionNext(GifFile, &ExtData) == GIF_ERROR)
973 return(GIF_ERROR); 973 return(GIF_ERROR);
974 else 974 else
975 { 975 {
976 ep = &sp->ExtensionBlocks[sp->ExtensionBlockCount++]; 976 ExtensionBlock *ep =
977 &sp->ExtensionBlocks[sp->ExtensionBlockCount++];
977 978
978 ep->ByteCount = ExtData[0]; 979 ep->ByteCount = ExtData[0];
979 ep->Bytes = (GifByteType *)xmalloc(ep->ByteCount * sizeof(GifByteType)); 980 ep->Bytes = (GifByteType *)xmalloc(ep->ByteCount * sizeof(GifByteType));
980 memcpy(ep->Bytes,ExtData,ep->ByteCount * sizeof(char)); 981 memcpy(ep->Bytes,ExtData,ep->ByteCount * sizeof(char));
981 } 982 }