diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-06 13:43:07 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-02-06 13:43:07 +0000 |
commit | 999da9c5e45fb533efe8782c9096794b9ad1c1b3 (patch) | |
tree | 6c5f31692f11428fb2e8fd4496a51c5bc9501b9e /src | |
parent | 9d6e7e5b1368ba45b0b71b7b1d5d193a4b24e8d1 (diff) |
fix refcounting in SkImage::NewRasterData
git-svn-id: http://skia.googlecode.com/svn/trunk@13338 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r-- | src/image/SkImage_Raster.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp index 32d53fc52e..ab8a635c1c 100644 --- a/src/image/SkImage_Raster.cpp +++ b/src/image/SkImage_Raster.cpp @@ -133,7 +133,7 @@ SkImage* SkImage::NewRasterCopy(const SkImageInfo& info, const void* pixels, siz } -SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* pixelData, size_t rowBytes) { +SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* data, size_t rowBytes) { if (!SkImage_Raster::ValidArgs(info, rowBytes)) { return NULL; } @@ -141,17 +141,16 @@ SkImage* SkImage::NewRasterData(const SkImageInfo& info, SkData* pixelData, size return SkImage_Raster::NewEmpty(); } // check this after empty-check - if (NULL == pixelData) { + if (NULL == data) { return NULL; } // did they give us enough data? size_t size = info.fHeight * rowBytes; - if (pixelData->size() < size) { + if (data->size() < size) { return NULL; } - SkAutoDataUnref data(pixelData); return SkNEW_ARGS(SkImage_Raster, (info, data, rowBytes)); } |