Title: [209177] trunk/Source/WebKit2
Revision
209177
Author
carlo...@webkit.org
Date
2016-11-30 23:51:51 -0800 (Wed, 30 Nov 2016)

Log Message

[GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
https://bugs.webkit.org/show_bug.cgi?id=164911

Reviewed by Michael Catanzaro.

The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
image. We only use the buffer to get the image size, so we could save the image size when the image is created,
and then we don't need to care about the buffer anymore.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
(WebKit::WaylandCompositor::Surface::commit):
* UIProcess/gtk/WaylandCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (209176 => 209177)


--- trunk/Source/WebKit2/ChangeLog	2016-12-01 07:05:42 UTC (rev 209176)
+++ trunk/Source/WebKit2/ChangeLog	2016-12-01 07:51:51 UTC (rev 209177)
@@ -1,3 +1,19 @@
+2016-11-30  Carlos Garcia Campos  <cgar...@igalia.com>
+
+        [GTK] UI process crash in WebKit::WaylandCompositor::Surface::prepareTextureForPainting
+        https://bugs.webkit.org/show_bug.cgi?id=164911
+
+        Reviewed by Michael Catanzaro.
+
+        The problem is that m_buffer is nullptr in Surface::prepareTextureForPainting() even though we have already an
+        image. We only use the buffer to get the image size, so we could save the image size when the image is created,
+        and then we don't need to care about the buffer anymore.
+
+        * UIProcess/gtk/WaylandCompositor.cpp:
+        (WebKit::WaylandCompositor::Surface::prepareTextureForPainting):
+        (WebKit::WaylandCompositor::Surface::commit):
+        * UIProcess/gtk/WaylandCompositor.h:
+
 2016-11-30  Antoine Quint  <grao...@apple.com>
 
         [Modern Media Controls] Add an HTML comment flag to turn the feature on

Modified: trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.cpp (209176 => 209177)


--- trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.cpp	2016-12-01 07:05:42 UTC (rev 209176)
+++ trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.cpp	2016-12-01 07:51:51 UTC (rev 209177)
@@ -214,7 +214,7 @@
     glImageTargetTexture2D(GL_TEXTURE_2D, m_image);
 
     texture = m_texture;
-    textureSize = m_buffer->size();
+    textureSize = m_imageSize;
     return true;
 }
 
@@ -227,6 +227,8 @@
     if (m_image == EGL_NO_IMAGE_KHR)
         return;
 
+    m_imageSize = m_pendingBuffer->size();
+
     makePendingBufferCurrent();
     if (m_webPage)
         m_webPage->setViewNeedsDisplay(IntRect(IntPoint::zero(), m_webPage->viewSize()));

Modified: trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.h (209176 => 209177)


--- trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.h	2016-12-01 07:05:42 UTC (rev 209176)
+++ trunk/Source/WebKit2/UIProcess/gtk/WaylandCompositor.h	2016-12-01 07:51:51 UTC (rev 209177)
@@ -97,6 +97,7 @@
         WeakPtr<Buffer> m_pendingBuffer;
         unsigned m_texture;
         EGLImageKHR m_image;
+        WebCore::IntSize m_imageSize;
         Vector<wl_resource*> m_frameCallbackList;
         WebPageProxy* m_webPage { nullptr };
     };
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to