]> git.saurik.com Git - wxWidgets.git/commitdiff
removed unneeded test for pal!=NULL in ConvertToImage() (coverity checker CID 10)
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:44:25 +0000 (23:44 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 7 Mar 2006 23:44:25 +0000 (23:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/gifdecod.cpp

index db8ac994df84931e58513134241eece23ed39480..8fda5f8ae137b2588d566077a4547b08500aac49 100644 (file)
@@ -142,21 +142,18 @@ bool wxGIFDecoder::ConvertToImage(wxImage *image) const
         image->SetMask(false);
 
 #if wxUSE_PALETTE
         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 */
 #endif // wxUSE_PALETTE
 
     /* copy image data */