From: Vadim Zeitlin Date: Mon, 18 Aug 2003 23:55:17 +0000 (+0000) Subject: return immediately if the XPM is bad instead of spitting out thousands of error messages X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3ffb81a42350ef0fe9161185480ed41d3f0e76dd return immediately if the XPM is bad instead of spitting out thousands of error messages git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23002 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/xpmdecod.cpp b/src/common/xpmdecod.cpp index 35e9b0b521..c6e10441c9 100644 --- a/src/common/xpmdecod.cpp +++ b/src/common/xpmdecod.cpp @@ -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 {