Fix clang static analyzer errors in Gr
Review URL: http://codereview.appspot.com/5433055/
git-svn-id: http://skia.googlecode.com/svn/trunk@2743 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/gpu/GrGpuGL.cpp b/src/gpu/GrGpuGL.cpp
index 093a53b..7e9b102 100644
--- a/src/gpu/GrGpuGL.cpp
+++ b/src/gpu/GrGpuGL.cpp
@@ -1763,8 +1763,13 @@
GrAssert(stencilBits ||
(GrStencilSettings::gDisabled ==
fCurrDrawState.fStencilSettings));
- GrGLuint clipStencilMask = 1 << (stencilBits - 1);
- GrGLuint userStencilMask = clipStencilMask - 1;
+
+ GrGLuint clipStencilMask = 0;
+ GrGLuint userStencilMask = ~0;
+ if (stencilBits > 0) {
+ clipStencilMask = 1 << (stencilBits - 1);
+ userStencilMask = clipStencilMask - 1;
+ }
unsigned int frontRef = settings->fFrontFuncRef;
unsigned int frontMask = settings->fFrontFuncMask;