Title: [92108] trunk/Source/WebKit2
Revision
92108
Author
commit-qu...@webkit.org
Date
2011-08-01 01:49:06 -0700 (Mon, 01 Aug 2011)

Log Message

Custom cursors cause the WebProcess to crash
https://bugs.webkit.org/show_bug.cgi?id=64802

Patch by Amruth Raj <amruth...@motorola.com> on 2011-08-01
Reviewed by Darin Adler.

* Shared/WebCoreArgumentCoders.cpp:
(CoreIPC::::encode): In case of a NULL cursor image, encode a bool indicating that.
(CoreIPC::::decode): Decode the image only if required.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (92107 => 92108)


--- trunk/Source/WebKit2/ChangeLog	2011-08-01 08:48:49 UTC (rev 92107)
+++ trunk/Source/WebKit2/ChangeLog	2011-08-01 08:49:06 UTC (rev 92108)
@@ -1,3 +1,14 @@
+2011-08-01  Amruth Raj  <amruth...@motorola.com>
+
+        Custom cursors cause the WebProcess to crash
+        https://bugs.webkit.org/show_bug.cgi?id=64802
+
+        Reviewed by Darin Adler.
+
+        * Shared/WebCoreArgumentCoders.cpp:
+        (CoreIPC::::encode): In case of a NULL cursor image, encode a bool indicating that.
+        (CoreIPC::::decode): Decode the image only if required.
+
 2011-07-31  Daniel Bates  <dba...@webkit.org>
 
         Try again to fix the WinCairo Debug build after r92059 ( https://bugs.webkit.org/show_bug.cgi?id=65419).

Modified: trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp (92107 => 92108)


--- trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp	2011-08-01 08:48:49 UTC (rev 92107)
+++ trunk/Source/WebKit2/Shared/WebCoreArgumentCoders.cpp	2011-08-01 08:49:06 UTC (rev 92108)
@@ -321,6 +321,12 @@
     if (cursor.type() != Cursor::Custom)
         return;
 
+    if (cursor.image()->isNull()) {
+        encoder->encodeBool(false); // There is no valid image being encoded.
+        return;
+    }
+
+    encoder->encodeBool(true);
     encodeImage(encoder, cursor.image());
     encoder->encode(cursor.hotSpot());
 }
@@ -344,6 +350,15 @@
         return true;
     }
 
+    bool isValidImagePresent;
+    if (!decoder->decode(isValidImagePresent))
+        return false;
+
+    if (!isValidImagePresent) {
+        cursor = Cursor(Image::nullImage(), IntPoint());
+        return true;
+    }
+
     RefPtr<Image> image;
     if (!decodeImage(decoder, image))
         return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to