From ac7d5e8d764cce98c43e2b5f68711dadb21d93da Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Mon, 14 Sep 2015 00:14:19 -0700 Subject: [PATCH] fix memory over-allocation in lossless rescaler init num_channels was not needed in sizeof(*scaled_data) Change-Id: Ie9ff31d7c1a262520fe1aac81dc57b53cb07bace --- src/dec/vp8l.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/dec/vp8l.c b/src/dec/vp8l.c index b8966232..a80661d8 100644 --- a/src/dec/vp8l.c +++ b/src/dec/vp8l.c @@ -421,7 +421,7 @@ static int AllocateAndInitRescaler(VP8LDecoder* const dec, VP8Io* const io) { const int out_height = io->scaled_height; const uint64_t work_size = 2 * num_channels * (uint64_t)out_width; int32_t* work; // Rescaler work area. - const uint64_t scaled_data_size = num_channels * (uint64_t)out_width; + const uint64_t scaled_data_size = (uint64_t)out_width; uint32_t* scaled_data; // Temporary storage for scaled BGRA data. const uint64_t memory_size = sizeof(*dec->rescaler) + work_size * sizeof(*work) +