comparison src/dgif_lib.c @ 321:19dcec799385 r21-0-58

Import from CVS: tag r21-0-58
author cvs
date Mon, 13 Aug 2007 10:46:44 +0200
parents 33bdb3d4b97f
children 54f7aa390f4f
comparison
equal deleted inserted replaced
320:73c75c43c1f2 321:19dcec799385
108 GifRead(Buf, GIF_STAMP_LEN, GifFile); 108 GifRead(Buf, GIF_STAMP_LEN, GifFile);
109 109
110 /* The GIF Version number is ignored at this time. Maybe we should do */ 110 /* The GIF Version number is ignored at this time. Maybe we should do */
111 /* something more useful with it. */ 111 /* something more useful with it. */
112 Buf[GIF_STAMP_LEN] = 0; 112 Buf[GIF_STAMP_LEN] = 0;
113 if (strncmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) { 113 if (strncmp(GIF_STAMP, (const char *) Buf, GIF_VERSION_POS) != 0) {
114 GifInternError(GifFile, D_GIF_ERR_NOT_GIF_FILE); 114 GifInternError(GifFile, D_GIF_ERR_NOT_GIF_FILE);
115 } 115 }
116 116
117 DGifGetScreenDesc(GifFile); 117 DGifGetScreenDesc(GifFile);
118 } 118 }
817 } 817 }
818 818
819 /****************************************************************************** 819 /******************************************************************************
820 * Image block allocation functions * 820 * Image block allocation functions *
821 ******************************************************************************/ 821 ******************************************************************************/
822 SavedImage *MakeSavedImage(GifFileType *GifFile, SavedImage *CopyFrom)
823 /* 822 /*
824 * Append an image block to the SavedImages array 823 * Append an image block to the SavedImages array
825 */ 824 */
825 SavedImage *
826 MakeSavedImage(GifFileType *GifFile, SavedImage *CopyFrom)
826 { 827 {
827 SavedImage *sp; 828 SavedImage *sp;
828 829
829 if (GifFile->SavedImages == NULL) 830 if (GifFile->SavedImages == NULL)
830 GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage)); 831 GifFile->SavedImages = (SavedImage *)malloc(sizeof(SavedImage));
854 sp->ImageDesc.ColorMap = 855 sp->ImageDesc.ColorMap =
855 MakeMapObject(CopyFrom->ImageDesc.ColorMap->ColorCount, 856 MakeMapObject(CopyFrom->ImageDesc.ColorMap->ColorCount,
856 CopyFrom->ImageDesc.ColorMap->Colors); 857 CopyFrom->ImageDesc.ColorMap->Colors);
857 858
858 /* next, the raster */ 859 /* next, the raster */
859 sp->RasterBits = (char *)malloc(sizeof(GifPixelType) 860 sp->RasterBits = (GifPixelType*)malloc(sizeof(GifPixelType)
860 * CopyFrom->ImageDesc.Height 861 * CopyFrom->ImageDesc.Height
861 * CopyFrom->ImageDesc.Width); 862 * CopyFrom->ImageDesc.Width);
862 memcpy(sp->RasterBits, 863 memcpy(sp->RasterBits,
863 CopyFrom->RasterBits, 864 CopyFrom->RasterBits,
864 sizeof(GifPixelType) 865 sizeof(GifPixelType)