X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/295dec28c369e6267ae5292e4b13f2b3c9bbedf6..80f218424f34e2ded439cc23631ea1b74c72f732:/src/common/gifdecod.cpp diff --git a/src/common/gifdecod.cpp b/src/common/gifdecod.cpp index db8ac994df..8fda5f8ae1 100644 --- a/src/common/gifdecod.cpp +++ b/src/common/gifdecod.cpp @@ -142,21 +142,18 @@ bool wxGIFDecoder::ConvertToImage(wxImage *image) const image->SetMask(false); #if wxUSE_PALETTE - if (pal) - { - unsigned char r[256]; - unsigned char g[256]; - unsigned char b[256]; + unsigned char r[256]; + unsigned char g[256]; + unsigned char b[256]; - for (i = 0; i < 256; i++) - { - r[i] = pal[3*i + 0]; - g[i] = pal[3*i + 1]; - b[i] = pal[3*i + 2]; - } - - image->SetPalette(wxPalette(256, r, g, b)); + for (i = 0; i < 256; i++) + { + r[i] = pal[3*i + 0]; + g[i] = pal[3*i + 1]; + b[i] = pal[3*i + 2]; } + + image->SetPalette(wxPalette(256, r, g, b)); #endif // wxUSE_PALETTE /* copy image data */