Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Issue 92793002: Fixed bad bitmap size crashes (Closed)

Created:
7 years ago by sugoi1
Modified:
7 years ago
CC:
skia-review_googlegroups.com
Visibility:
Public.

Description

Fixed bad bitmap size crashes There were 2 issues : 1 ) If the size of an SkBitmap's underlying SkPixelRef's alocated memory is too small to fit the bitmap, then the deserialization will now check this and set an error appropriately. 2 ) If a device fails to allocate its pixels, the device will be deleted and NULL will be returned to avoid attempting to draw on a bad device. BUG= Committed: http://code.google.com/p/skia/source/detail?r=12484

Patch Set 1 #

Total comments: 1

Patch Set 2 : Added unit tests #

Total comments: 1

Patch Set 3 : Added more randomness to fuzzer and fixed related issues #

Total comments: 5

Patch Set 4 : Added dox #

Patch Set 5 : Added time.h #

Patch Set 6 : Changed getSize name to getAllocatedSizeInBytes #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -22 lines) Patch
M include/core/SkMallocPixelRef.h View 1 2 3 4 5 2 chunks +3 lines, -2 lines 1 comment Download
M include/core/SkPixelRef.h View 1 2 3 4 5 1 chunk +10 lines, -0 lines 0 comments Download
M samplecode/SampleFilterFuzz.cpp View 1 2 3 4 7 chunks +39 lines, -10 lines 0 comments Download
M src/core/SkBitmap.cpp View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
M src/core/SkBitmapDevice.cpp View 3 chunks +16 lines, -4 lines 0 comments Download
M src/core/SkPixelRef.cpp View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M src/effects/SkBlurImageFilter.cpp View 1 2 1 chunk +4 lines, -0 lines 0 comments Download
M src/effects/SkColorFilterImageFilter.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M src/effects/SkDropShadowImageFilter.cpp View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/effects/SkLightingImageFilter.cpp View 1 2 3 chunks +7 lines, -0 lines 0 comments Download
M src/effects/SkMagnifierImageFilter.cpp View 1 2 4 chunks +14 lines, -6 lines 0 comments Download
M src/effects/SkMatrixConvolutionImageFilter.cpp View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/effects/SkMorphologyImageFilter.cpp View 1 2 2 chunks +6 lines, -0 lines 0 comments Download
M src/effects/SkOffsetImageFilter.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M src/effects/SkRectShaderImageFilter.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M src/effects/SkTileImageFilter.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M src/effects/SkXfermodeImageFilter.cpp View 1 chunk +3 lines, -0 lines 0 comments Download
M src/image/SkDataPixelRef.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M src/image/SkDataPixelRef.cpp View 1 2 3 4 5 1 chunk +4 lines, -0 lines 0 comments Download
M tests/SerializationTest.cpp View 1 5 chunks +103 lines, -0 lines 0 comments Download

Messages

Total messages: 26 (0 generated)
sugoi
7 years ago (2013-11-27 21:28:57 UTC) #1
Stephen White
LGTM for src/effects. Leaving the rest for Mike. https://codereview.chromium.org/92793002/diff/1/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): https://codereview.chromium.org/92793002/diff/1/include/core/SkPixelRef.h#newcode261 include/core/SkPixelRef.h:261: virtual ...
7 years ago (2013-11-27 21:52:49 UTC) #2
reed1
As this will be redundant when my rowbytes/info CL lands... 1. Are there real crashes ...
7 years ago (2013-11-27 21:56:01 UTC) #3
sugoi
On 2013/11/27 21:56:01, reed1 wrote: > As this will be redundant when my rowbytes/info CL ...
7 years ago (2013-11-27 22:05:28 UTC) #4
reed1
On 2013/11/27 22:05:28, sugoi wrote: > On 2013/11/27 21:56:01, reed1 wrote: > > As this ...
7 years ago (2013-11-27 22:09:45 UTC) #5
Stephen White
On 2013/11/27 21:56:01, reed1 wrote: > As this will be redundant when my rowbytes/info CL ...
7 years ago (2013-11-27 22:22:13 UTC) #6
sugoi
Added tests https://codereview.chromium.org/92793002/diff/20001/src/core/SkBitmap.cpp File src/core/SkBitmap.cpp (right): https://codereview.chromium.org/92793002/diff/20001/src/core/SkBitmap.cpp#newcode1572 src/core/SkBitmap.cpp:1572: Simplified this a bit by using getSafeSize()
7 years ago (2013-11-28 18:22:40 UTC) #7
sugoi
I added more "randomness" to the fuzzer and fixed most of the issues found by ...
7 years ago (2013-11-29 20:32:42 UTC) #8
Stephen White
effects/ still LGTM. https://codereview.chromium.org/92793002/diff/40001/src/effects/SkMagnifierImageFilter.cpp File src/effects/SkMagnifierImageFilter.cpp (right): https://codereview.chromium.org/92793002/diff/40001/src/effects/SkMagnifierImageFilter.cpp#newcode288 src/effects/SkMagnifierImageFilter.cpp:288: if ((src.config() != SkBitmap::kARGB_8888_Config) || Should ...
7 years ago (2013-12-02 15:33:23 UTC) #9
sugoi1
https://codereview.chromium.org/92793002/diff/40001/src/effects/SkMagnifierImageFilter.cpp File src/effects/SkMagnifierImageFilter.cpp (right): https://codereview.chromium.org/92793002/diff/40001/src/effects/SkMagnifierImageFilter.cpp#newcode288 src/effects/SkMagnifierImageFilter.cpp:288: if ((src.config() != SkBitmap::kARGB_8888_Config) || On 2013/12/02 15:33:24, Stephen ...
7 years ago (2013-12-02 15:42:56 UTC) #10
sugoi
I extracted a subset of this cl into https://codereview.chromium.org/102213002/. I'll update this one once the ...
7 years ago (2013-12-03 16:24:22 UTC) #11
reed1
There are now other CLs that may block the rowbytes CL, so lets see if ...
7 years ago (2013-12-03 19:02:50 UTC) #12
sugoi
https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h#newcode260 include/core/SkPixelRef.h:260: // default impl returns 0. On 2013/12/03 19:02:50, reed1 ...
7 years ago (2013-12-03 19:07:22 UTC) #13
sugoi
https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h File include/core/SkPixelRef.h (right): https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h#newcode260 include/core/SkPixelRef.h:260: // default impl returns 0. On 2013/12/03 19:02:50, reed1 ...
7 years ago (2013-12-03 19:18:06 UTC) #14
reed1
On 2013/12/03 19:07:22, sugoi wrote: > https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h > File include/core/SkPixelRef.h (right): > > https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h#newcode260 > ...
7 years ago (2013-12-03 19:29:08 UTC) #15
sugoi
On 2013/12/03 19:29:08, reed1 wrote: > On 2013/12/03 19:07:22, sugoi wrote: > > https://codereview.chromium.org/92793002/diff/40001/include/core/SkPixelRef.h > ...
7 years ago (2013-12-03 19:36:58 UTC) #16
reed1
On 2013/12/03 19:36:58, sugoi wrote: > On 2013/12/03 19:29:08, reed1 wrote: > > On 2013/12/03 ...
7 years ago (2013-12-03 19:55:38 UTC) #17
sugoi
On 2013/12/03 19:55:38, reed1 wrote: > On 2013/12/03 19:36:58, sugoi wrote: > > On 2013/12/03 ...
7 years ago (2013-12-03 20:26:43 UTC) #18
reed1
On 2013/12/03 20:26:43, sugoi wrote: > On 2013/12/03 19:55:38, reed1 wrote: > > On 2013/12/03 ...
7 years ago (2013-12-03 20:47:01 UTC) #19
sugoi
On 2013/12/03 20:47:01, reed1 wrote: > On 2013/12/03 20:26:43, sugoi wrote: > > On 2013/12/03 ...
7 years ago (2013-12-03 21:11:39 UTC) #20
reed1
On 2013/12/03 21:11:39, sugoi wrote: > On 2013/12/03 20:47:01, reed1 wrote: > > On 2013/12/03 ...
7 years ago (2013-12-03 22:15:19 UTC) #21
sugoi
On 2013/12/03 22:15:19, reed1 wrote: > On 2013/12/03 21:11:39, sugoi wrote: > > On 2013/12/03 ...
7 years ago (2013-12-04 04:52:52 UTC) #22
sugoi
https://codereview.chromium.org/92793002/diff/100001/include/core/SkMallocPixelRef.h File include/core/SkMallocPixelRef.h (right): https://codereview.chromium.org/92793002/diff/100001/include/core/SkMallocPixelRef.h#newcode40 include/core/SkMallocPixelRef.h:40: virtual size_t getAllocatedSizeInBytes() const SK_OVERRIDE { return fSize; } ...
7 years ago (2013-12-04 16:20:31 UTC) #23
reed1
lgtm
7 years ago (2013-12-04 16:36:49 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/sugoi@chromium.org/92793002/100001
7 years ago (2013-12-04 16:39:42 UTC) #25
commit-bot: I haz the power
7 years ago (2013-12-04 17:06:58 UTC) #26
Message was sent while issue was closed.
Change committed as 12484

Powered by Google App Engine
This is Rietveld 408576698