Fixed SVACE errors 50/179950/2
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 23 May 2018 11:21:59 +0000 (12:21 +0100)
committerAdeel Kazmi <adeel.kazmi@samsung.com>
Wed, 23 May 2018 15:45:43 +0000 (16:45 +0100)
Change-Id: Idfd3444bad32d616259f7716cb77c178de31c4e8

dali/devel-api/adaptor-framework/gif-loading.cpp
dali/internal/imaging/common/file-download.h

index ba9db54..c1c6725 100755 (executable)
@@ -688,10 +688,20 @@ bool ReadHeader( LoaderInfo &loaderInfo,
         FILE * const fp = fileReader.GetFile();
         if ( NULL != fp )
         {
-          fseek( fp, 0, SEEK_SET );
-          fileData.globalMap = reinterpret_cast<GifByteType*>( malloc(sizeof( GifByteType ) * blobSize ) );
-          fileData.length = fread( fileData.globalMap, sizeof( GifByteType ), blobSize, fp);
-          fileInfo.map = fileData.globalMap;
+          if( ( ! fseek( fp, 0, SEEK_SET ) ) )
+          {
+            fileData.globalMap = reinterpret_cast<GifByteType*>( malloc(sizeof( GifByteType ) * blobSize ) );
+            fileData.length = fread( fileData.globalMap, sizeof( GifByteType ), blobSize, fp);
+            fileInfo.map = fileData.globalMap;
+          }
+          else
+          {
+            DALI_LOG_ERROR( "Error seeking within file\n" );
+          }
+        }
+        else
+        {
+          DALI_LOG_ERROR( "Error reading file\n" );
         }
       }
     }
@@ -1185,6 +1195,13 @@ public:
     ReadHeader( loaderInfo, imageProperties, &error );
   }
 
+  // Moveable but not copyable
+
+  Impl( const Impl& ) = delete;
+  Impl& operator=( const Impl& ) = delete;
+  Impl( Impl&& ) = default;
+  Impl& operator=( Impl&& ) = default;
+
   ~Impl()
   {
     if( loaderInfo.fileData.globalMap  )
index 20380a0..c7fb345 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TIZEN_PLATFORM_NETWORK_FILE_DOWNLOAD_H__
 
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2018 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.
@@ -52,6 +52,13 @@ public:
    */
   ~CurlEnvironment();
 
+  // Moveable but not copyable
+
+  CurlEnvironment( const CurlEnvironment& ) = delete;
+  CurlEnvironment& operator=( const CurlEnvironment& ) = delete;
+  CurlEnvironment( CurlEnvironment&& ) = default;
+  CurlEnvironment& operator=( CurlEnvironment&& ) = default;
+
   /**
    * Locking function for libcurl with openssl
    */