[Tizen] Check if a texture is valid 01/232501/2 accepted/tizen/5.5/unified/20200507.152328 submit/tizen_5.5/20200506.070459
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 6 May 2020 04:52:04 +0000 (13:52 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 6 May 2020 04:53:51 +0000 (13:53 +0900)
Change-Id: Ia5541d3340435aa14b9254983ad42660bbb63f0f

dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/texture-manager-impl.cpp

index da553d9..86d477d 100755 (executable)
@@ -515,9 +515,12 @@ void ImageVisual::GetNaturalSize( Vector2& naturalSize )
     if( textureSet )
     {
       auto texture = textureSet.GetTexture(0);
-      naturalSize.x = texture.GetWidth();
-      naturalSize.y = texture.GetHeight();
-      return;
+      if( texture )
+      {
+        naturalSize.x = texture.GetWidth();
+        naturalSize.y = texture.GetHeight();
+        return;
+      }
     }
   }
 
index 81bdeb1..a741239 100644 (file)
@@ -200,7 +200,6 @@ TextureSet TextureManager::LoadTexture(
     if( !data )
     {
       // use broken image
-      textureSet = TextureSet::New();
       Devel::PixelBuffer pixelBuffer = LoadImageFromFile( mBrokenImageUrl );
       if( pixelBuffer )
       {