mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[rdtk] fix integer narrow
This commit is contained in:
@@ -78,18 +78,6 @@ static int rdtk_image_copy_alpha_blend(uint8_t* pDstData, int nDstStep, int nXDs
|
|||||||
int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight,
|
int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth, int nHeight,
|
||||||
rdtkNinePatch* ninePatch)
|
rdtkNinePatch* ninePatch)
|
||||||
{
|
{
|
||||||
int x = 0;
|
|
||||||
int y = 0;
|
|
||||||
int width = 0;
|
|
||||||
int height = 0;
|
|
||||||
int nXSrc = 0;
|
|
||||||
int nYSrc = 0;
|
|
||||||
int nSrcStep = 0;
|
|
||||||
int nDstStep = 0;
|
|
||||||
uint8_t* pSrcData = NULL;
|
|
||||||
uint8_t* pDstData = NULL;
|
|
||||||
int scaleWidth = 0;
|
|
||||||
|
|
||||||
WINPR_ASSERT(surface);
|
WINPR_ASSERT(surface);
|
||||||
WINPR_ASSERT(ninePatch);
|
WINPR_ASSERT(ninePatch);
|
||||||
|
|
||||||
@@ -101,19 +89,20 @@ int rdtk_nine_patch_draw(rdtkSurface* surface, int nXDst, int nYDst, int nWidth,
|
|||||||
|
|
||||||
WINPR_UNUSED(nHeight);
|
WINPR_UNUSED(nHeight);
|
||||||
|
|
||||||
scaleWidth = nWidth - (ninePatch->width - ninePatch->scaleWidth);
|
int scaleWidth = nWidth - (ninePatch->width - ninePatch->scaleWidth);
|
||||||
nSrcStep = ninePatch->scanline;
|
int nSrcStep = ninePatch->scanline;
|
||||||
pSrcData = ninePatch->data;
|
const uint8_t* pSrcData = ninePatch->data;
|
||||||
pDstData = surface->data;
|
uint8_t* pDstData = surface->data;
|
||||||
nDstStep = surface->scanline;
|
WINPR_ASSERT(surface->scanline <= INT_MAX);
|
||||||
|
int nDstStep = (int)surface->scanline;
|
||||||
/* top */
|
/* top */
|
||||||
x = 0;
|
int x = 0;
|
||||||
y = 0;
|
int y = 0;
|
||||||
/* top left */
|
/* top left */
|
||||||
nXSrc = 0;
|
int nXSrc = 0;
|
||||||
nYSrc = 0;
|
int nYSrc = 0;
|
||||||
width = ninePatch->scaleLeft;
|
int width = ninePatch->scaleLeft;
|
||||||
height = ninePatch->scaleTop;
|
int height = ninePatch->scaleTop;
|
||||||
rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData,
|
rdtk_image_copy_alpha_blend(pDstData, nDstStep, nXDst + x, nYDst + y, width, height, pSrcData,
|
||||||
nSrcStep, nXSrc, nYSrc);
|
nSrcStep, nXSrc, nYSrc);
|
||||||
x += width;
|
x += width;
|
||||||
|
|||||||
Reference in New Issue
Block a user