summaryrefslogtreecommitdiff
path: root/libs/rs/rsProgramFragment.cpp
diff options
context:
space:
mode:
author Jason Sams <rjsams@android.com> 2010-11-22 16:27:59 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2010-11-22 16:27:59 -0800
commitd2a5a0b584efd4bf2c44acadf99f6250f0f65927 (patch)
tree9e68c2809895f18bde1ea0b1ff6815cd5c000f61 /libs/rs/rsProgramFragment.cpp
parent077b6ed354fa6f0fd8387e87cf3883d9ca252529 (diff)
parentadd9d9633205f76cc34f04368b8482c2c369ba63 (diff)
Merge "More error checks"
Diffstat (limited to 'libs/rs/rsProgramFragment.cpp')
-rw-r--r--libs/rs/rsProgramFragment.cpp6
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++;