X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3f4fc7967b595ea8257696baff78e1866511223d..161f4f7380e945b0769ad5f7122df55b8777396a:/src/common/gifdecod.cpp?ds=sidebyside diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index 5cec45e69b..828afb82c8 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -126,7 +126,6 @@ bool wxGIFDecoder::ConvertToImage(wxImage *image) const else image->SetMask(FALSE); - // Set the palette if (pal) { unsigned char* r = new unsigned char[256]; @@ -333,10 +332,15 @@ int wxGIFDecoder::getcode(int bits, int ab_fin) // int wxGIFDecoder::dgif(GIFImage *img, int interl, int bits) { +#ifdef __WXMAC__ + int *ab_prefix = new int[4096]; /* alphabet (prefixes) */ + int *ab_tail = new int[4096]; /* alphabet (tails) */ + int *stack = new int[4096]; /* decompression stack */ +#else int ab_prefix[4096]; /* alphabet (prefixes) */ int ab_tail[4096]; /* alphabet (tails) */ int stack[4096]; /* decompression stack */ - +#endif int ab_clr; /* clear code */ int ab_fin; /* end of info code */ int ab_bits; /* actual symbol width, in bits */ @@ -460,6 +464,11 @@ int wxGIFDecoder::dgif(GIFImage *img, int interl, int bits) } while (code != ab_fin); +#ifdef __WXMAC__ + delete [] ab_prefix ; + delete [] ab_tail ; + delete [] stack ; +#endif return 0; } @@ -492,10 +501,11 @@ int wxGIFDecoder::ReadGIF() int ncolors, bits, interl, transparent, disposal, i; long size; long delay; - unsigned char type; + unsigned char type = 0; unsigned char pal[768]; unsigned char buf[16]; - GIFImage **ppimg, *pimg, *pprev; + GIFImage **ppimg; + GIFImage *pimg, *pprev; /* check GIF signature */ if (!CanRead())