]> git.saurik.com Git - wxWidgets.git/commitdiff
Call GetAlpha() to get a pointer instead of checking for alpha first.
authorDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Sun, 28 Aug 2011 21:27:34 +0000 (21:27 +0000)
committerDimitri Schoolwerth <dimitri.schoolwerth@gmail.com>
Sun, 28 Aug 2011 21:27:34 +0000 (21:27 +0000)
It's safe to call GetAlpha() even if there's no alpha because in that case NULL will be returned.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68939 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagtiff.cpp

index c71497af3b4c27d040311da80a135ec2c75036f4..5229f62fdfc164595ee1f47d8c9c307e05712397 100644 (file)
@@ -411,7 +411,7 @@ bool wxTIFFHandler::LoadFile( wxImage *image, wxInputStream& stream, bool verbos
     unsigned char *ptr = image->GetData();
     ptr += w*3*(h-1);
 
-    unsigned char *alpha = hasAlpha ? image->GetAlpha() : NULL;
+    unsigned char *alpha = image->GetAlpha();
     if ( hasAlpha )
         alpha += w*(h-1);