From a57c40005ca3b5dfcf17ec87c573955abf488745 Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Wed, 25 Sep 2013 20:07:44 -0400 Subject: [PATCH] Small bug: don't allocate more memory than we have to. --- PVRTCEncoder/src/Decompressor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PVRTCEncoder/src/Decompressor.cpp b/PVRTCEncoder/src/Decompressor.cpp index 48d2ecb..a367ada 100644 --- a/PVRTCEncoder/src/Decompressor.cpp +++ b/PVRTCEncoder/src/Decompressor.cpp @@ -304,10 +304,10 @@ namespace PVRTCC { // First, extract all of the block information... std::vector blocks; - blocks.reserve(w * h); const uint32 blocksW = bTwoBitMode? (w / 8) : (w / 4); const uint32 blocksH = h / 4; + blocks.reserve(blocksW * blocksH); for(uint32 j = 0; j < blocksH; j++) { for(uint32 i = 0; i < blocksW; i++) {