Fixing SVACE issue in loader-ktx.cpp 37/288837/1
authorAdam Bialogonski <adam.b@samsung.com>
Thu, 23 Feb 2023 10:39:12 +0000 (10:39 +0000)
committerAdam Bialogonski <adam.b@samsung.com>
Thu, 23 Feb 2023 10:39:24 +0000 (10:39 +0000)
SIGN_EXTENSION issue.

Change-Id: I69f35590db6852ad577b13857be7faf205bf4a1d

dali/internal/imaging/common/loader-ktx.cpp

index f4ab1e2..c876d55 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
@@ -547,8 +547,8 @@ bool LoadBitmapFromKtx(const Dali::ImageLoader::Input& input, Dali::Devel::Pixel
   }
 
   // Skip the key-values:
-  const long int imageSizeOffset = sizeof(KtxFileHeader) + fileHeader.bytesOfKeyValueData;
-  if(DALI_UNLIKELY(fseek(fp, imageSizeOffset, SEEK_SET)))
+  const auto imageSizeOffset = sizeof(KtxFileHeader) + fileHeader.bytesOfKeyValueData;
+  if(DALI_UNLIKELY(fseek(fp, (long int)(imageSizeOffset), SEEK_SET)))
   {
     DALI_LOG_ERROR("Seek past key/vals in KTX compressed bitmap file failed.\n");
     return false;