/*
- * Copyright (c) 2016 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.
char *GifExtension,
GraphicsControlBlock *GCB)
{
- if (GifExtensionLength != 4) {
+ if (GifExtensionLength != 4)
+ {
return GIF_ERROR;
}
GCB->UserInputFlag = (GifExtension[0] & 0x02) != 0;
GCB->DelayTime = UNSIGNED_LITTLE_ENDIAN(GifExtension[1], GifExtension[2]);
if (GifExtension[0] & 0x01)
- GCB->TransparentColor = ((int)GifExtension[3]+256)%256;
+ {
+ GCB->TransparentColor = reinterpret_cast< int >( GifExtension[3]+256 ) % 256;
+ }
else
+ {
GCB->TransparentColor = NO_TRANSPARENT_COLOR;
+ }
return GIF_OK;
}
return DGifExtensionToGCB(ep->ByteCount, ep->Bytes, GCB);
}
- return GIF_OK;
+ return GIF_ERROR;
}
/******************************************************************************
{
// Fetch the graphics control block
GraphicsControlBlock graphicsControlBlock;
- if( int errorCode = DGifSavedExtensionToGCB( gifInfo, frameIndex, &graphicsControlBlock ) != GIF_OK )
+ if( int errorCode = DGifSavedExtensionToGCB( gifInfo, frameIndex, &graphicsControlBlock ) != GIF_OK
+ && gifInfo->ImageCount > 1 ) // for static gif, graphics control block may not been specified
{
DALI_LOG_ERROR( "GIF Loader: DGifSavedExtensionToGCB Error. Code: %d\n", errorCode );
}