@@ -78,11 +78,11 @@ namespace IMCodec
7878 return mPluginProperties ;
7979 }
8080
81- uint8_t GetValue (uint8_t bitWidth, const uint8_t * address, int position)
81+ uint8_t GetValue (uint8_t bitWidth, const uint8_t * address, size_t position)
8282 {
8383 const int mask = (1 << bitWidth) - 1 ;
8484 const int PixelsInOneByte = CHAR_BIT / bitWidth;
85- const int byteOffset = position / PixelsInOneByte;
85+ const size_t byteOffset = position / PixelsInOneByte;
8686 const int bitOffset = (CHAR_BIT - ((position % PixelsInOneByte) + 1 ) * bitWidth);
8787 const uint8_t currentByte = address[byteOffset];
8888 uint8_t value = ((currentByte & (mask << bitOffset))) >> bitOffset;
@@ -181,7 +181,7 @@ namespace IMCodec
181181 }
182182
183183 const auto texelSize = IMCodec::GetTexelInfo (imageItem->descriptor .texelFormatDecompressed ).texelSize ;
184- imageItem->descriptor .rowPitchInBytes = LLUtils::Utility::Align<size_t >(bmpInfo.biWidth * texelSize / CHAR_BIT, sizeof (uint32_t ));
184+ imageItem->descriptor .rowPitchInBytes = LLUtils::Utility::Align<uint32_t >(bmpInfo.biWidth * texelSize / CHAR_BIT, sizeof (uint32_t ));
185185 const size_t destDataSize = imageItem->descriptor .rowPitchInBytes * imageItem->descriptor .height ;
186186
187187
@@ -208,7 +208,7 @@ namespace IMCodec
208208
209209 for (size_t x = 0 ; x < imageItem->descriptor .width ; x++)
210210 {
211- uint8_t pixelIndex = GetValue (bmpInfo.biBitCount , baseSourceAddress + sourceLineOffset, x);
211+ uint8_t pixelIndex = GetValue (static_cast < uint8_t >( bmpInfo.biBitCount ) , baseSourceAddress + sourceLineOffset, x);
212212 uint32_t color = 0xFF << 24 | colorTable[pixelIndex];
213213 uint32_t * currentpixel = reinterpret_cast <uint32_t *>(reinterpret_cast <uint8_t *>(imageItem->data .data ()) + destLineOffset) + x;
214214 *currentpixel = color;
0 commit comments