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

Issue 116773002: Fixed more fuzzer issues (Closed)

Created:
7 years ago by sugoi1
Modified:
7 years ago
CC:
skia-review_googlegroups.com
Base URL:
https://skia.googlesource.com/skia.git@master
Visibility:
Public.

Description

Fixed more fuzzer issues - Added the "isAvailable" function to check how much bytes are remaining in the stream before doing potentially large mallocs. That way, we can signal a bad stream instead of crashing. - Added data validation in SkImageInfo.cpp - Added NULL pointer check in displacement - Modified the fuzzer for randomized bitmap types BUG=328934, 329254 Committed: http://code.google.com/p/skia/source/detail?r=12723

Patch Set 1 #

Total comments: 6

Patch Set 2 : Changed isAvailable for validateAvailable #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+90 lines, -23 lines) Patch
M include/core/SkFlattenableBuffers.h View 1 2 chunks +15 lines, -2 lines 0 comments Download
M samplecode/SampleFilterFuzz.cpp View 3 chunks +19 lines, -9 lines 0 comments Download
M src/core/SkColorTable.cpp View 1 1 chunk +9 lines, -2 lines 1 comment Download
M src/core/SkImageInfo.cpp View 2 chunks +10 lines, -0 lines 0 comments Download
M src/core/SkMallocPixelRef.cpp View 1 1 chunk +7 lines, -2 lines 0 comments Download
M src/core/SkValidatingReadBuffer.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/core/SkValidatingReadBuffer.cpp View 1 1 chunk +4 lines, -0 lines 0 comments Download
M src/effects/SkDashPathEffect.cpp View 1 1 chunk +7 lines, -2 lines 0 comments Download
M src/effects/SkDisplacementMapEffect.cpp View 1 chunk +1 line, -1 line 1 comment Download
M src/effects/SkMergeImageFilter.cpp View 1 chunk +2 lines, -1 line 0 comments Download
M src/effects/SkTableColorFilter.cpp View 1 chunk +1 line, -0 lines 0 comments Download
M src/effects/gradients/SkGradientShader.cpp View 1 1 chunk +7 lines, -2 lines 0 comments Download
M src/images/SkImageRef.cpp View 1 1 chunk +6 lines, -2 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
sugoi
7 years ago (2013-12-16 21:41:46 UTC) #1
reed1
https://codereview.chromium.org/116773002/diff/1/include/core/SkFlattenableBuffers.h File include/core/SkFlattenableBuffers.h (right): https://codereview.chromium.org/116773002/diff/1/include/core/SkFlattenableBuffers.h#newcode172 include/core/SkFlattenableBuffers.h:172: virtual bool isAvailable(size_t size) const = 0; Do we ...
7 years ago (2013-12-16 21:53:13 UTC) #2
sugoi
https://codereview.chromium.org/116773002/diff/1/include/core/SkFlattenableBuffers.h File include/core/SkFlattenableBuffers.h (right): https://codereview.chromium.org/116773002/diff/1/include/core/SkFlattenableBuffers.h#newcode172 include/core/SkFlattenableBuffers.h:172: virtual bool isAvailable(size_t size) const = 0; On 2013/12/16 ...
7 years ago (2013-12-17 15:55:45 UTC) #3
reed1
not a biggie, but perhaps the total length should just be provided to the readbuffer ...
7 years ago (2013-12-17 16:38:05 UTC) #4
sugoi
On 2013/12/17 16:38:05, reed1 wrote: > not a biggie, but perhaps the total length should ...
7 years ago (2013-12-17 18:52:05 UTC) #5
reed1
On 2013/12/17 18:52:05, sugoi wrote: > On 2013/12/17 16:38:05, reed1 wrote: > > not a ...
7 years ago (2013-12-17 18:54:41 UTC) #6
sugoi
On 2013/12/17 18:54:41, reed1 wrote: > On 2013/12/17 18:52:05, sugoi wrote: > > On 2013/12/17 ...
7 years ago (2013-12-17 19:22:47 UTC) #7
reed1
On 2013/12/17 19:22:47, sugoi wrote: > On 2013/12/17 18:54:41, reed1 wrote: > > On 2013/12/17 ...
7 years ago (2013-12-17 19:25:15 UTC) #8
sugoi
On 2013/12/17 19:25:15, reed1 wrote: > On 2013/12/17 19:22:47, sugoi wrote: > > On 2013/12/17 ...
7 years ago (2013-12-17 19:43:49 UTC) #9
reed1
Thanks for exploring the offset/size path. I concede that available is the way to go. ...
7 years ago (2013-12-17 19:46:58 UTC) #10
sugoi
On 2013/12/17 19:46:58, reed1 wrote: > Thanks for exploring the offset/size path. I concede that ...
7 years ago (2013-12-17 19:54:55 UTC) #11
reed1
On 2013/12/17 19:54:55, sugoi wrote: > On 2013/12/17 19:46:58, reed1 wrote: > > Thanks for ...
7 years ago (2013-12-17 19:57:38 UTC) #12
reed1
lgtm
7 years ago (2013-12-17 19:58:02 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://skia-tree-status.appspot.com/cq/sugoi@chromium.org/116773002/20001
7 years ago (2013-12-17 20:01:46 UTC) #14
commit-bot: I haz the power
Change committed as 12723
7 years ago (2013-12-17 20:49:55 UTC) #15
Stephen White
7 years ago (2013-12-18 00:01:13 UTC) #16
Message was sent while issue was closed.
https://codereview.chromium.org/116773002/diff/20001/src/core/SkColorTable.cpp
File src/core/SkColorTable.cpp (right):

https://codereview.chromium.org/116773002/diff/20001/src/core/SkColorTable.cp...
src/core/SkColorTable.cpp:95: if (buffer.validateAvailable(allocSize)) {
Not new to this patch, but I'm really starting to wonder if we should get rid of
these constructors, and replace them with factory functions that take an
SkFlattenableReadBuffer& instead. Then we could early-out and return NULL
whenever validation fails, and not worry about partially-initialized objects.

https://codereview.chromium.org/116773002/diff/20001/src/effects/SkDisplaceme...
File src/effects/SkDisplacementMapEffect.cpp (right):

https://codereview.chromium.org/116773002/diff/20001/src/effects/SkDisplaceme...
src/effects/SkDisplacementMapEffect.cpp:191: !displacementInput ||
!displacementInput->filterImage(proxy, src, ctm, &displ, offset)) {
I don't think it should abort on a NULL displacementInput. All NULL inputs
should just default to the source bitmap.

i.e., SkBitmap displ = src, color = src;

...

displacementInput && !displacementInput->filterImage(...)
  return false;

Powered by Google App Engine
This is Rietveld 408576698