[CherryPick] TextureMapperSurfaceBackingStore should check if GraphicsSurface is...
authorzeno.albisser@digia.com <zeno.albisser@digia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Oct 2012 19:17:19 +0000 (19:17 +0000)
committerYongGeol Jung <yg48.jung@samsung.com>
Thu, 4 Apr 2013 11:30:24 +0000 (20:30 +0900)
[Title] [CherryPick] TextureMapperSurfaceBackingStore should check if GraphicsSurface is valid.
[Issues] N_SE-32071
[Problem] Force close occurred when tapped on the "full screen view" button of Video Test of TizenWinset.
[Solution] Cherry picked.

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.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@132118 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Conflicts:

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp

Change-Id: Icbe5b6d139304cc3671be06249538a839112a731

Source/WebCore/platform/graphics/texmap/TextureMapperBackingStore.cpp

index 8ab1625..b799d79 100755 (executable)
@@ -73,7 +73,8 @@ PassRefPtr<BitmapTexture> TextureMapperSurfaceBackingStore::texture() const
 
 void TextureMapperSurfaceBackingStore::paintToTextureMapper(TextureMapper* textureMapper, const FloatRect& targetRect, const TransformationMatrix& transform, float opacity)
 {
-    m_graphicsSurface->paintToTextureMapper(textureMapper, targetRect, transform, opacity);
+    if (m_graphicsSurface)
+        m_graphicsSurface->paintToTextureMapper(textureMapper, targetRect, transform, opacity);
 }
 
 void TextureMapperSurfaceBackingStore::setSurface(PassRefPtr<GraphicsSurface> surface)