Home | Info | Community | Development | myReactOS | Contact Us
Definition at line 915 of file ungif.c.
Referenced by GifDecoder_Initialize().
{ unsigned char Buf[GIF_STAMP_LEN + 1]; GifFileType *GifFile; GifFilePrivateType *Private; GifFile = ungif_alloc(sizeof(GifFileType)); if (GifFile == NULL) { return NULL; } memset(GifFile, '\0', sizeof(GifFileType)); Private = ungif_alloc(sizeof(GifFilePrivateType)); if (!Private) { ungif_free(GifFile); return NULL; } GifFile->Private = (void*)Private; Private->Read = readFunc; /* TVT */ GifFile->UserData = userData; /* TVT */ /* Lets see if this is a GIF file: */ if (READ(GifFile, Buf, GIF_STAMP_LEN) != GIF_STAMP_LEN) { ungif_free(Private); ungif_free(GifFile); return NULL; } /* The GIF Version number is ignored at this time. Maybe we should do * something more useful with it. */ Buf[GIF_STAMP_LEN] = 0; if (memcmp(GIF_STAMP, Buf, GIF_VERSION_POS) != 0) { ungif_free(Private); ungif_free(GifFile); return NULL; } if (DGifGetScreenDesc(GifFile) == GIF_ERROR) { ungif_free(Private); ungif_free(GifFile); return NULL; } return GifFile; }