From 59e4e673033d86dc815fa4f44058d8e903d340d4 Mon Sep 17 00:00:00 2001 From: Angie Chiang Date: Tue, 20 Nov 2018 15:30:43 -0800 Subject: [PATCH] Fix scan_build warnings in vp9_resize.c BUG=webm:1575 Change-Id: I5722d2626b9043b83581a700e58c2b7204113a16 --- vp9/encoder/vp9_resize.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vp9/encoder/vp9_resize.c b/vp9/encoder/vp9_resize.c index 6ac77aeef..23a320ae5 100644 --- a/vp9/encoder/vp9_resize.c +++ b/vp9/encoder/vp9_resize.c @@ -424,11 +424,11 @@ void vp9_resize_plane(const uint8_t *const input, int height, int width, int in_stride, uint8_t *output, int height2, int width2, int out_stride) { int i; - uint8_t *intbuf = (uint8_t *)malloc(sizeof(uint8_t) * width2 * height); + uint8_t *intbuf = (uint8_t *)calloc(width2 * height, sizeof(*intbuf)); uint8_t *tmpbuf = - (uint8_t *)malloc(sizeof(uint8_t) * (width < height ? height : width)); - uint8_t *arrbuf = (uint8_t *)malloc(sizeof(uint8_t) * height); - uint8_t *arrbuf2 = (uint8_t *)malloc(sizeof(uint8_t) * height2); + (uint8_t *)calloc(width < height ? height : width, sizeof(*tmpbuf)); + uint8_t *arrbuf = (uint8_t *)calloc(height, sizeof(*arrbuf)); + uint8_t *arrbuf2 = (uint8_t *)calloc(height2, sizeof(*arrbuf2)); if (intbuf == NULL || tmpbuf == NULL || arrbuf == NULL || arrbuf2 == NULL) goto Error; assert(width > 0); -- 2.40.0