From 1d746208a1335a192433923b4a818ded3978228d Mon Sep 17 00:00:00 2001 From: Mike Klein Date: Thu, 25 Jan 2018 17:32:51 -0500 Subject: 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 Reviewed-by: Hal Canary Reviewed-by: Cary Clark Commit-Queue: Mike Klein --- src/gpu/gl/GrGLGpu.cpp | 2 +- src/gpu/gl/builders/GrGLProgramBuilder.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gpu/gl') 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(dst->asTexture()); - const GrGLTexture* srcTex = static_cast(dst->asTexture()); + const GrGLTexture* srcTex = static_cast(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 key = SkData::MakeWithoutCopy(desc()->asKey(), desc()->keyLength()); GrGLenum binaryFormat; - std::unique_ptr binary(new char[length]); + std::unique_ptr binary(new char[length]); GL_CALL(GetProgramBinary(programID, length, &length, &binaryFormat, binary.get())); size_t dataLength = sizeof(inputs) + sizeof(binaryFormat) + length; - std::unique_ptr data((uint8_t*) malloc(dataLength)); + std::unique_ptr data(new uint8_t[dataLength]); size_t offset = 0; memcpy(data.get() + offset, &inputs, sizeof(inputs)); offset += sizeof(inputs); -- cgit v1.2.3