- Integer overflow may occur due to arithmetic operation.
: fileHeader.zsize is unsigned char[], and zDepth is unsigned int
Change-Id: I9fbd76a1e8f52933a50ae4b014ec361db3a6babf
Signed-off-by: Seoyeon Kim <seoyeon2.kim@samsung.com>
width = fileHeader.xsize[0] | ( fileHeader.xsize[1] << 8 ) | ( fileHeader.xsize[2] << 16 );
height = fileHeader.ysize[0] | ( fileHeader.ysize[1] << 8 ) | ( fileHeader.ysize[2] << 16 );
- const unsigned int zDepth = fileHeader.zsize[0] + ( fileHeader.zsize[1] << 8 ) + ( fileHeader.zsize[2] << 16 );
+ const unsigned int zDepth = static_cast<unsigned int>( fileHeader.zsize[0] )
+ + ( static_cast<unsigned int>( fileHeader.zsize[1] ) << 8 )
+ + ( static_cast<unsigned int>( fileHeader.zsize[2] ) << 16 );
// Check image dimensions are within limits.
if( ( width > MAX_TEXTURE_DIMENSION ) || ( height > MAX_TEXTURE_DIMENSION ) )