skia2/resources/sksl/runtime_errors/ProgramTooLarge_Extreme.rts
John Stiles a047e8bf4d Improve overflow checks in CheckProgramUnrolledSize.
The fuzzer discovered that it could overflow the program-size value.
Rewrote the logic to use SkSafeMath everywhere, and to early-exit as
soon as a statement manages to exceed the program size.

Change-Id: I01511b2201173c95ebc1ac602901410ac9d74d73
Bug: oss-fuzz:38697
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/449098
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
Auto-Submit: John Stiles <johnstiles@google.com>
2021-09-15 16:42:45 +00:00

16 lines
526 B
Plaintext

half4 main(float2 xy) {
int i;
for (int a=0; a<10000; ++a) // 10000
for (int b=0; b<10000; ++b) // 100000000
for (int c=0; c<10000; ++c) // 1000000000000
for (int d=0; d<10000; ++d) // 10000000000000000
for (int e=0; e<10000; ++e) // 100000000000000000000
for (int f=0; f<10000; ++f) // 1000000000000000000000000
for (int g=0; g<10000; ++g) // 10000000000000000000000000000
for (int h=0; h<10000; ++h) // 100000000000000000000000000000000 (over 2^100)
++i;
return half4(0);
}