diff options
author | Mike Klein <mtklein@chromium.org> | 2018-01-25 17:32:51 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-26 15:37:48 +0000 |
commit | 1d746208a1335a192433923b4a818ded3978228d (patch) | |
tree | 08c2925624a1ba9c002faaea63c698e68f91becc /src/gpu/gl | |
parent | 5a907a7cce9a5ca72357f06e7874136d12b867b8 (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')
-rw-r--r-- | src/gpu/gl/GrGLGpu.cpp | 2 | ||||
-rw-r--r-- | src/gpu/gl/builders/GrGLProgramBuilder.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp index 0037ca1681..d48c82eae0 100644 --- a/src/gpu/gl/GrGLGpu.cpp +++ b/src/gpu/gl/GrGLGpu.cpp @@ -3314,7 +3314,7 @@ static inline bool can_blit_framebuffer_for_copy_surface( // have filtered such cases out. SkASSERT(GrPixelConfigIsSint(dst->config()) == GrPixelConfigIsSint(src->config())); const GrGLTexture* dstTex = static_cast<const GrGLTexture*>(dst->asTexture()); - const GrGLTexture* srcTex = static_cast<const GrGLTexture*>(dst->asTexture()); + const GrGLTexture* srcTex = static_cast<const GrGLTexture*>(src->asTexture()); const GrRenderTarget* dstRT = dst->asRenderTarget(); const GrRenderTarget* srcRT = src->asRenderTarget(); if (dstTex && dstTex->target() != GR_GL_TEXTURE_2D) { 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); |