[Tizen] Fix Coverity issue 01/233201/1 accepted/tizen/5.5/unified/20200513.143932 submit/tizen_5.5/20200513.034922
authorhuiyu.eun <huiyu.eun@samsung.com>
Wed, 13 May 2020 03:24:09 +0000 (12:24 +0900)
committerhuiyu.eun <huiyu.eun@samsung.com>
Wed, 13 May 2020 03:31:01 +0000 (12:31 +0900)
Change-Id: Ic0aa4fdf49d80f950708c750a8f1244dfd47eec5
Signed-off-by: huiyu.eun <huiyu.eun@samsung.com>
dali/internal/legacy/common/tizen-platform-abstraction.cpp

index c9b1230..d9e82fb 100644 (file)
@@ -268,6 +268,11 @@ bool LoadFile( const std::string& filename, Dali::Vector< unsigned char > & buff
   }
 
   int length = lseek(fd, 0, SEEK_END);
+  if (length <= 0)
+  {
+    close( fd );
+    return false;
+  }
   buffer.Resize( length );
 
   lseek(fd, 0, SEEK_SET);