diff --git a/libfreerdp/gdi/pen.c b/libfreerdp/gdi/pen.c index 4d0a3a373..cbd091edc 100644 --- a/libfreerdp/gdi/pen.c +++ b/libfreerdp/gdi/pen.c @@ -52,7 +52,8 @@ HGDI_PEN gdi_CreatePen(UINT32 fnPenStyle, UINT32 nWidth, UINT32 crColor, UINT32 hPen->objectType = GDIOBJECT_PEN; hPen->style = fnPenStyle; hPen->color = crColor; - hPen->width = nWidth; + WINPR_ASSERT(nWidth <= INT32_MAX); + hPen->width = (int)nWidth; hPen->format = format; hPen->palette = palette; return hPen;