Fixed clang malloc integer overflow warnings.

This commit is contained in:
Armin Novak
2017-05-30 10:46:43 +02:00
parent 8292b4558f
commit 0490aeb018
63 changed files with 123 additions and 124 deletions

View File

@@ -266,7 +266,7 @@ static BOOL test_peer_load_icon(freerdp_peer* client)
/* Max */
fgets(line, sizeof(line), fp);
if (!(rgb_data = malloc(context->icon_width * context->icon_height * 3)))
if (!(rgb_data = calloc(context->icon_height, context->icon_width * 3)))
goto out_fail;
for (i = 0; i < context->icon_width * context->icon_height * 3; i++)
@@ -278,8 +278,7 @@ static BOOL test_peer_load_icon(freerdp_peer* client)
}
/* background with same size, which will be used to erase the icon from old position */
if (!(context->bg_data = malloc(context->icon_width * context->icon_height *
3)))
if (!(context->bg_data = calloc(context->icon_height, context->icon_width * 3)))
goto out_fail;
memset(context->bg_data, 0xA0, context->icon_width * context->icon_height * 3);