[Tizen] Fix SVACE issue
[platform/core/uifw/dali-adaptor-legacy.git] / dali / internal / imaging / common / loader-png.cpp
index 4b51af3..55a3149 100755 (executable)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -308,6 +308,12 @@ bool LoadBitmapFromPng( const Dali::ImageLoader::Input& input, Dali::Devel::Pixe
 
   DALI_ASSERT_DEBUG(pixels);
   rows = reinterpret_cast< png_bytep* >( malloc(sizeof(png_bytep) * height) );
+  if(!rows)
+  {
+    DALI_LOG_ERROR("malloc is failed\n");
+    return false;
+  }
+
   for(y=0; y<height; y++)
   {
     rows[y] = pixels + y * stride;