mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-14 00:14:11 +09:00
[codec,color] add freerdp_glyph_convert_ex
The function freerdp_glyph_convert does not check input buffer length, deprecate it and provide a replacement that does properly check.
This commit is contained in:
@@ -288,6 +288,7 @@ typedef struct gdi_palette gdiPalette;
|
||||
return (FreeRDPGetBitsPerPixel(format) + 7) / 8;
|
||||
}
|
||||
|
||||
#if !defined(WITHOUT_FREERDP_3x_DEPRECATED)
|
||||
/***
|
||||
*
|
||||
* @param width width to copy in pixels
|
||||
@@ -297,9 +298,27 @@ typedef struct gdi_palette gdiPalette;
|
||||
* @return A buffer allocated with winpr_aligned_malloc(width * height, 16)
|
||||
* if successful, NULL otherwise.
|
||||
*/
|
||||
|
||||
WINPR_DEPRECATED_VAR("[since 3.21.0] use freerdp_glyph_convert_ex instead",
|
||||
WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
|
||||
FREERDP_API BYTE* freerdp_glyph_convert(
|
||||
UINT32 width, UINT32 height, const BYTE* WINPR_RESTRICT data));
|
||||
#endif
|
||||
|
||||
/***
|
||||
*
|
||||
* @param width width to copy in pixels
|
||||
* @param height height to copy in pixels
|
||||
* @param data source buffer, must be (nWidth + 7) / 8 bytes long
|
||||
* @param len the length of \ref data in bytes
|
||||
*
|
||||
* @return A buffer allocated with winpr_aligned_malloc(width * height, 16)
|
||||
* if successful, NULL otherwise.
|
||||
* @since version 3.21.0
|
||||
*/
|
||||
WINPR_ATTR_MALLOC(winpr_aligned_free, 1)
|
||||
FREERDP_API BYTE* freerdp_glyph_convert(UINT32 width, UINT32 height,
|
||||
const BYTE* WINPR_RESTRICT data);
|
||||
FREERDP_API BYTE* freerdp_glyph_convert_ex(UINT32 width, UINT32 height,
|
||||
const BYTE* WINPR_RESTRICT data, size_t len);
|
||||
|
||||
/***
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user