/*
- * 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.
DALI_LOG_ERROR("Error decoding BMP_RGB24V5 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RGB24V5 data\n");
return false;
if(padding)
{
// move past the padding.
- if(DALI_UNLIKELY(fseek(fp, padding, SEEK_CUR)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(padding)), SEEK_CUR)))
{
DALI_LOG_ERROR("Error moving past BMP_RGB24V5 padding\n");
}
DALI_LOG_ERROR("Error decoding BMP_BITFIELDS32V4 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_BITFIELDS32V4 data\n");
return false;
if(padding)
{
// move past the padding.
- if(DALI_UNLIKELY(fseek(fp, padding, SEEK_CUR)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(padding)), SEEK_CUR)))
{
DALI_LOG_ERROR("Error moving past BMP_BITFIELDS32V4 padding\n");
}
DALI_LOG_ERROR("Error decoding BMP_BITFIELDS32 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_BITFIELDS32 data\n");
return false;
if(padding)
{
// move past the padding.
- if(DALI_UNLIKELY(fseek(fp, padding, SEEK_CUR)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(padding)), SEEK_CUR)))
{
DALI_LOG_ERROR("Error moving past BMP_BITFIELDS32 padding\n");
}
DALI_LOG_ERROR("Error decoding RGB565 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking RGB565 data\n");
return false;
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_BITFIELDS555 data\n");
return false;
DALI_LOG_ERROR("Error decoding BMP_RGB555 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RGB555 data\n");
return false;
DALI_LOG_ERROR("Error decoding BMP_RGB1 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RGB1 data\n");
return false;
DALI_LOG_ERROR("Error decoding BMP_RGB4 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RGB4 data\n");
return false;
DALI_LOG_ERROR("Error decoding BMP_RGB8 format\n");
return false;
}
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RGB8 data\n");
return false;
bool finish = false;
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RLE4 data\n");
return false;
std::uint8_t cmd[2];
std::vector<std::uint8_t> colorIndex(width * height);
- if(DALI_UNLIKELY(fseek(fp, offset, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(offset)), SEEK_SET)))
{
DALI_LOG_ERROR("Error seeking BMP_RLE8 data\n");
return false;
{
if(infoHeader.bitsPerPixel == 16)
{
- if(DALI_UNLIKELY(fseek(fp, 14 + infoHeader.infoHeaderSize + 1, SEEK_SET)))
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(14 + infoHeader.infoHeaderSize + 1)), SEEK_SET)))
{
return false;
}
if(padding)
{
- if(DALI_UNLIKELY(fseek(fp, padding, SEEK_CUR))) // move past the padding.
+ if(DALI_UNLIKELY(fseek(fp, static_cast<long>(static_cast<size_t>(padding)), SEEK_CUR))) // move past the padding.
{
DALI_LOG_ERROR("Error moving past BMP padding\n");
}