]> git.saurik.com Git - wxWidgets.git/commitdiff
Check the number of points in the image map in wxHTML.
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 17 Jul 2013 17:27:09 +0000 (17:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 17 Jul 2013 17:27:09 +0000 (17:27 +0000)
Don't crash if an <area> element is incorrect and doesn't have the required
number of coords attributes.

Closes #15348.

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

docs/changes.txt
src/html/m_image.cpp

index 0eebedff240ff1f2c8b147d227a3acc025173d4d..7c306a61f8da92fe3fed9b1b99c6d5da80fc56b5 100644 (file)
@@ -557,6 +557,14 @@ Major new features in this release
   was added.
 
 
+3.0: (released 2013-09-??)
+--------------------------
+
+All (GUI):
+
+- Fix crash in wxHTML on mal-formed <area> elements (LukasK).
+
+
 2.9.5: (released 2013-07-15)
 ----------------------------
 
index bce9c33235f802be0ee155a8c7c989646ddd6150..dae30f3b0b7b13ad777f88979798da5638882f82 100644 (file)
@@ -95,6 +95,7 @@ wxHtmlLinkInfo *wxHtmlImageMapAreaCell::GetLink( int x, int y ) const
     switch (type)
     {
         case RECT:
+            if ( coords.GetCount() == 4 )
             {
                 int l, t, r, b;
 
@@ -106,9 +107,10 @@ wxHtmlLinkInfo *wxHtmlImageMapAreaCell::GetLink( int x, int y ) const
                 {
                     return m_Link;
                 }
-                break;
             }
+            break;
         case CIRCLE:
+            if ( coords.GetCount() == 3 )
             {
                 int l, t, r;
                 double  d;