diff options
author | 2010-11-22 16:20:16 -0800 | |
---|---|---|
committer | 2010-11-22 16:20:16 -0800 | |
commit | add9d9633205f76cc34f04368b8482c2c369ba63 (patch) | |
tree | cc360ce8783627e98c05f764d99c70dc29cc5b87 /libs/rs/rsProgramFragment.cpp | |
parent | 83d97c8c7ddff9374f876bef48758414a7775cb1 (diff) |
More error checks
Change-Id: Id2b9ab7a76bbdf2ed745f5e36e552dc9b101982f
Diffstat (limited to 'libs/rs/rsProgramFragment.cpp')
-rw-r--r-- | libs/rs/rsProgramFragment.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libs/rs/rsProgramFragment.cpp b/libs/rs/rsProgramFragment.cpp index ffa7d269fd78..0713fb377b96 100644 --- a/libs/rs/rsProgramFragment.cpp +++ b/libs/rs/rsProgramFragment.cpp @@ -136,9 +136,9 @@ void ProgramFragment::createShader() { char buf[256]; for (uint32_t ct=0; ct < mTextureCount; ct++) { if (mTextureTargets[ct] == RS_TEXTURE_2D) { - sprintf(buf, "uniform sampler2D UNI_Tex%i;\n", ct); + snprintf(buf, sizeof(buf), "uniform sampler2D UNI_Tex%i;\n", ct); } else { - sprintf(buf, "uniform samplerCube UNI_Tex%i;\n", ct); + snprintf(buf, sizeof(buf), "uniform samplerCube UNI_Tex%i;\n", ct); } mShader.append(buf); } @@ -159,7 +159,7 @@ void ProgramFragment::init(Context *rsc) { mTextureUniformIndexStart = uniformIndex; char buf[256]; for (uint32_t ct=0; ct < mTextureCount; ct++) { - sprintf(buf, "UNI_Tex%i", ct); + snprintf(buf, sizeof(buf), "UNI_Tex%i", ct); mUniformNames[uniformIndex].setTo(buf); mUniformArraySizes[uniformIndex] = 1; uniformIndex++; |