diff options
| author | 2010-11-22 16:27:59 -0800 | |
|---|---|---|
| committer | 2010-11-22 16:27:59 -0800 | |
| commit | d2a5a0b584efd4bf2c44acadf99f6250f0f65927 (patch) | |
| tree | 9e68c2809895f18bde1ea0b1ff6815cd5c000f61 /libs/rs/rsProgramFragment.cpp | |
| parent | 077b6ed354fa6f0fd8387e87cf3883d9ca252529 (diff) | |
| parent | add9d9633205f76cc34f04368b8482c2c369ba63 (diff) | |
Merge "More error checks"
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++; |