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

Issue 2010843002: Fix int32 overflow in LinearGradientContext::shade4_dx_clamp (Closed)

Created:
4 years, 7 months ago by f(malita)
Modified:
4 years, 7 months ago
Reviewers:
mtklein, caryclark, reed1
CC:
reviews_skia.org
Base URL:
https://chromium.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Fix int32 overflow in LinearGradientContext::shade4_dx_clamp The unconditional increment in shade4_dx_clamp can overflow int32 => n == SK_MinS32 => count ~= SK_MinS32 => we skip the main shader loop 'cause count < 0 R=reed@google.com,mtklein@google.com BUG=chromium:599458 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2010843002 Committed: https://skia.googlesource.com/skia/+/7b38e3cf75296c749c843fa89af14f70f4e4b2db

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+28 lines, -2 lines) Patch
M src/effects/gradients/SkLinearGradient.cpp View 2 chunks +8 lines, -2 lines 0 comments Download
M tests/GradientTest.cpp View 2 chunks +20 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
f(malita)
4 years, 7 months ago (2016-05-25 22:17:52 UTC) #3
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2010843002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2010843002/1
4 years, 7 months ago (2016-05-25 22:18:06 UTC) #5
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-25 22:31:55 UTC) #7
commit-bot: I haz the power
Dry run: None
4 years, 7 months ago (2016-05-25 22:32:04 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2010843002/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/2010843002/1
4 years, 7 months ago (2016-05-26 14:02:56 UTC) #10
commit-bot: I haz the power
Note for Reviewers: The CQ is waiting for an approval. If you believe that the ...
4 years, 7 months ago (2016-05-26 14:02:57 UTC) #11
reed1
Is the overflow possibility just from the + 1, or can the float->int conversion also ...
4 years, 7 months ago (2016-05-26 17:38:30 UTC) #13
f(malita)
On 2016/05/26 17:38:30, reed1 wrote: > Is the overflow possibility just from the + 1, ...
4 years, 7 months ago (2016-05-26 17:40:32 UTC) #14
reed1
wow, I had no idea we were still using the hacky floatbits code for that. ...
4 years, 7 months ago (2016-05-26 18:12:29 UTC) #15
commit-bot: I haz the power
Committed patchset #1 (id:1) as https://skia.googlesource.com/skia/+/7b38e3cf75296c749c843fa89af14f70f4e4b2db
4 years, 7 months ago (2016-05-26 18:13:55 UTC) #17
mtklein
Hmmm... that's weird: https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Debug-ASAN/builds/6992/steps/test_skia%20on%20Ubuntu/logs/stdio ../../../src/effects/gradients/SkLinearGradient.cpp:630:74: runtime error: signed integer overflow: 2147483647 + 1 cannot be ...
4 years, 7 months ago (2016-05-26 23:26:13 UTC) #18
f(malita)
4 years, 7 months ago (2016-05-26 23:30:17 UTC) #19
Message was sent while issue was closed.
On 2016/05/26 23:26:13, mtklein wrote:
> Hmmm... that's weird:
> 
>
https://build.chromium.org/p/client.skia/builders/Test-Ubuntu-GCC-GCE-CPU-AVX...
> 
> ../../../src/effects/gradients/SkLinearGradient.cpp:630:74: runtime error:
> signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'
> SUMMARY: AddressSanitizer: undefined-behavior
> ../../../src/effects/gradients/SkLinearGradient.cpp:630:74 in 
> step returned non-zero exit code: 1

Heh, I guess the unit test is now triggering it.  This is WAI, but will have to
silence it somehow...

Powered by Google App Engine
This is Rietveld 408576698