aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/builders/GrGLProgramBuilder.cpp
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2018-01-25 17:32:51 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-26 15:37:48 +0000
commit1d746208a1335a192433923b4a818ded3978228d (patch)
tree08c2925624a1ba9c002faaea63c698e68f91becc /src/gpu/gl/builders/GrGLProgramBuilder.cpp
parent5a907a7cce9a5ca72357f06e7874136d12b867b8 (diff)
bug fixes from PVS Studio (static analysis)
- Hal, please check out SkPDFCanon... was this unused? - Cary, please SkOpContour... is it right that allDone isn't necessary? - Brian, the rest? Bug: chromium:805881 Change-Id: I7cbbcf44f4460a114f4ed2a59ed3856203049cdc Reviewed-on: https://skia-review.googlesource.com/99960 Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Hal Canary <halcanary@google.com> Reviewed-by: Cary Clark <caryclark@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'src/gpu/gl/builders/GrGLProgramBuilder.cpp')
-rw-r--r--src/gpu/gl/builders/GrGLProgramBuilder.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gpu/gl/builders/GrGLProgramBuilder.cpp b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
index f906773efc..7ae63a262c 100644
--- a/src/gpu/gl/builders/GrGLProgramBuilder.cpp
+++ b/src/gpu/gl/builders/GrGLProgramBuilder.cpp
@@ -274,10 +274,10 @@ GrGLProgram* GrGLProgramBuilder::finalize() {
// store shader in cache
sk_sp<SkData> key = SkData::MakeWithoutCopy(desc()->asKey(), desc()->keyLength());
GrGLenum binaryFormat;
- std::unique_ptr<char> binary(new char[length]);
+ std::unique_ptr<char[]> binary(new char[length]);
GL_CALL(GetProgramBinary(programID, length, &length, &binaryFormat, binary.get()));
size_t dataLength = sizeof(inputs) + sizeof(binaryFormat) + length;
- std::unique_ptr<uint8_t> data((uint8_t*) malloc(dataLength));
+ std::unique_ptr<uint8_t[]> data(new uint8_t[dataLength]);
size_t offset = 0;
memcpy(data.get() + offset, &inputs, sizeof(inputs));
offset += sizeof(inputs);