/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 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.
if(DALI_LIKELY(!fseek(fp, 0, SEEK_SET)))
{
- globalMap = reinterpret_cast<GifByteType*>(malloc(sizeof(GifByteType) * length));
- length = fread(globalMap, sizeof(GifByteType), length, fp);
+ globalMap = reinterpret_cast<GifByteType*>(malloc(sizeof(GifByteType) * static_cast<unsigned long long>(length)));
+ if(DALI_UNLIKELY(globalMap == nullptr))
+ {
+ DALI_LOG_ERROR("malloc is failed. request malloc size : %llu\n", sizeof(GifByteType) * static_cast<unsigned long long>(length));
+ return false;
+ }
+ length = fread(globalMap, sizeof(GifByteType), length, fp);
}
else
{
if(DALI_LIKELY(!fseek(fp, 0, SEEK_SET)))
{
globalMap = reinterpret_cast<GifByteType*>(malloc(sizeof(GifByteType) * blobSize));
- length = fread(globalMap, sizeof(GifByteType), blobSize, fp);
- succeeded = true;
+ if(DALI_UNLIKELY(globalMap == nullptr))
+ {
+ DALI_LOG_ERROR("malloc is failed. request malloc size : %zu\n", sizeof(GifByteType) * blobSize);
+ }
+ else
+ {
+ length = fread(globalMap, sizeof(GifByteType), blobSize, fp);
+ succeeded = true;
+ }
}
else
{
delete mImpl;
}
-Dali::Devel::PixelBuffer GifLoading::LoadFrame(uint32_t frameIndex)
+Dali::Devel::PixelBuffer GifLoading::LoadFrame(uint32_t frameIndex, ImageDimensions desiredSize)
{
int error;
Dali::Devel::PixelBuffer pixelBuffer;