Title: [132118] trunk/Source/WebCore
Revision
132118
Author
zeno.albis...@digia.com
Date
2012-10-22 12:17:19 -0700 (Mon, 22 Oct 2012)

Log Message

TextureMapperSurfaceBackingStore should check if GraphicsSurface is valid.
https://bugs.webkit.org/show_bug.cgi?id=100002

Reviewed by Kenneth Rohde Christiansen.

* platform/graphics/texmap/TextureMapperBackingStore.cpp:
(WebCore::TextureMapperSurfaceBackingStore::setGraphicsSurface):
    Check if a surface has been created before accessing the pointer.
(WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
    Check if m_graphicsSurface is a valid pointer before dereferencing it.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (132117 => 132118)


--- trunk/Source/WebCore/ChangeLog	2012-10-22 19:11:13 UTC (rev 132117)
+++ trunk/Source/WebCore/ChangeLog	2012-10-22 19:17:19 UTC (rev 132118)
@@ -1,3 +1,16 @@
+2012-10-22  Zeno Albisser  <z...@webkit.org>
+
+        TextureMapperSurfaceBackingStore should check if GraphicsSurface is valid.
+        https://bugs.webkit.org/show_bug.cgi?id=100002
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * platform/graphics/texmap/TextureMapperBackingStore.cpp:
+        (WebCore::TextureMapperSurfaceBackingStore::setGraphicsSurface):
+            Check if a surface has been created before accessing the pointer.
+        (WebCore::TextureMapperSurfaceBackingStore::paintToTextureMapper):
+            Check if m_graphicsSurface is a valid pointer before dereferencing it.
+
 2012-10-22  Michael Saboff  <msab...@apple.com>
 
         r131955 is has improper function call in LinkHashChromium.cpp

Modified: trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp (132117 => 132118)


--- trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp	2012-10-22 19:11:13 UTC (rev 132117)
+++ trunk/Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp	2012-10-22 19:17:19 UTC (rev 132118)
@@ -44,7 +44,7 @@
     }
 
     RefPtr<WebCore::GraphicsSurface> surface = graphicsSurface();
-    if (surface->frontBuffer() != frontBuffer)
+    if (surface && surface->frontBuffer() != frontBuffer)
         surface->swapBuffers();
 
 }
@@ -58,7 +58,8 @@
 
 void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity, BitmapTexture* mask)
 {
-    m_graphicsSurface->paintToTextureMapper(textureMapper, targetRect, transform, opacity, mask);
+    if (m_graphicsSurface)
+        m_graphicsSurface->paintToTextureMapper(textureMapper, targetRect, transform, opacity, mask);
 }
 
 void TextureMapperSurfaceBackingStore::setSurface(PassRefPtr<GraphicsSurface> surface)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to