diff options
author | 2012-11-01 18:03:48 +0000 | |
---|---|---|
committer | 2012-11-01 18:03:48 +0000 | |
commit | c7a24d23f7df30f8b15ecfd59cdec08d1532700d (patch) | |
tree | f53c0a25a0215ce98e1c2322c5c1845b1a6357fc /gm | |
parent | b9086a026844e4cfd08b219e49ce3f12294cba98 (diff) |
Check modulo values passed to GM.
R=reed@google.com
Review URL: https://codereview.appspot.com/6820073
git-svn-id: http://skia.googlecode.com/svn/trunk@6248 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/gmmain.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index a4c88b1b6b..e9c265b946 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -816,7 +816,7 @@ namespace skiagm { #if SK_SUPPORT_GPU SkAutoTUnref<GrContext> gGrContext; /** - * Sets the global GrContext, accessible by indivual GMs + * Sets the global GrContext, accessible by individual GMs */ static void SetGr(GrContext* grContext) { SkSafeRef(grContext); @@ -953,6 +953,10 @@ int tool_main(int argc, char** argv) { continue; } moduloDivisor = atoi(*argv); + if (moduloRemainder < 0 || moduloDivisor <= 0 || moduloRemainder >= moduloDivisor) { + SkDebugf("invalid modulo values."); + return -1; + } } else if (strcmp(*argv, "--nopdf") == 0) { doPDF = false; } else if (strcmp(*argv, "--nopipe") == 0) { |