/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2017 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.
template<typename T>
inline bool ReadHeader(FILE* fp, T& header)
{
- unsigned int readLength = sizeof(T);
+ const unsigned int readLength = sizeof(T);
// Load the information directly into our structure
- if (fread((void*)&header, 1, readLength, fp) != readLength)
+ if ( fread( &header, 1, readLength, fp ) != readLength )
{
return false;
}
width = infoHeader.width;
height = abs(infoHeader.height);
+ if( infoHeader.width == 0 )
+ {
+ return false;
+ }
+
return true;
}
}
for(unsigned int j = 0; j < fillw; j ++)
{
- int ctIndex = 0;
+ unsigned int ctIndex = 0;
if((fillw * index + j ) < (fillw * height))
{
ctIndex = colorIndex[ fillw * index + j ];
colorIndex[i] = cmd >> 4;
colorIndex[i + 1] = cmd & (0x0F);
}
- int ctIndex = 0;
+ unsigned int ctIndex = 0;
for(unsigned int index = 0; index < height; index = index + 1)
{
colorIndex[i] = cmd;
}
- int ctIndex = 0;
+ unsigned int ctIndex = 0;
for(unsigned int index = 0; index < height; index = index + 1)
{
PixelBuffer *pixelsPtr = NULL;
char colorTable[64];
std::vector<char> colorIndex(width * height >> 1);
std::vector<char> run;
- int x = 0;
- int y = 0;
- int dx = 0;
- int dy = 0;
+ unsigned int x = 0;
+ unsigned int y = 0;
+ unsigned int dx = 0;
+ unsigned int dy = 0;
width += (width & 1);
width = width >> 1;
return false;
}
PixelBuffer *pixelsPtr = pixels;
- int x = 0;
- int y = 0;
+ unsigned int x = 0;
+ unsigned int y = 0;
unsigned int cmdStride = 2;
width = ((width & 3) != 0) ? width + 4 - (width & 3) : width;
return false;
}
- int dx = 0;
- int dy = 0;
+ unsigned int dx = 0;
+ unsigned int dy = 0;
bool finish = false;
unsigned int length = 0;
unsigned int copylength = 0;
return ret;
}
-bool LoadBitmapFromBmp( const ResourceLoadingClient& client, const ImageLoader::Input& input, Integration::Bitmap& bitmap )
+bool LoadBitmapFromBmp( const ImageLoader::Input& input, Integration::Bitmap& bitmap )
{
DALI_ASSERT_DEBUG( bitmap.GetPackedPixelsProfile() != 0 && "Need a packed pixel bitmap to load into." );
FILE* const fp = input.file;
{
pixels = bitmap.GetPackedPixelsProfile()->ReserveBuffer(pixelFormat, infoHeader.width, infoHeader.height);
}
+ else
+ {
+ pixelBufferW = infoHeader.width;
+ pixelBufferH = infoHeader.height;
+ newPixelFormat = pixelFormat;
+ }
break;
}
}
case BMP_RGB4:
{
- decodeResult = DecodeRGB4(fp, pixels, infoHeader.width, infoHeader.height, 14 + infoHeader.infoHeaderSize, topDown);
+ decodeResult = DecodeRGB4(fp, pixels, infoHeader.width, abs(infoHeader.height), 14 + infoHeader.infoHeaderSize, topDown);
break;
}
case BMP_RLE4: