From: Angie Chiang Date: Tue, 20 Nov 2018 23:30:43 +0000 (-0800) Subject: Fix scan_build warnings in vp9_resize.c X-Git-Tag: v1.8.0~133^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=59e4e673033d86dc815fa4f44058d8e903d340d4;p=libvpx Fix scan_build warnings in vp9_resize.c BUG=webm:1575 Change-Id: I5722d2626b9043b83581a700e58c2b7204113a16 --- 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);