]> git.saurik.com Git - wxWidgets.git/commitdiff
return immediately if the XPM is bad instead of spitting out thousands of error messages
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Aug 2003 23:55:17 +0000 (23:55 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 18 Aug 2003 23:55:17 +0000 (23:55 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/xpmdecod.cpp

index 35e9b0b521563b2cc96b9c38f808a7c4871e8071..c6e10441c9e209eff003645acd821ae35d435a4f 100644 (file)
@@ -758,6 +758,12 @@ wxImage wxXPMDecoder::ReadData(const char **xpm_data)
             if ( entry == end )
             {
                 wxLogError(_("XPM: Malformed pixel data!"));
+
+                // better return right now as otherwise we risk to flood the
+                // user with error messages as something seems to be seriously
+                // wrong with the file and so we could give this message for
+                // each remaining pixel if we don't bail out
+                return wxNullImage;
             }
             else
             {