diff options
author | Ian Romanick <[email protected]> | 2012-07-25 15:39:50 -0700 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2012-08-29 15:09:34 -0700 |
commit | c13f36ce4e34821144ca6479e4bc3598b598d855 (patch) | |
tree | 83e38d448108c1398b66abed8a66375d0a820e99 /src/mesa/main/getstring.c | |
parent | 6a9b8f897a8b59fae03c73e05203bc708fb17793 (diff) |
mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper
Signed-off-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/getstring.c')
-rw-r--r-- | src/mesa/main/getstring.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 1734fb3f5e7..c99486a4bb3 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -129,23 +129,28 @@ _mesa_GetString( GLenum name ) return (const GLubyte *) ctx->Extensions.String; #if FEATURE_ARB_shading_language_100 || FEATURE_ES2 case GL_SHADING_LANGUAGE_VERSION: + if (ctx->API == API_OPENGLES) + break; return shading_language_version(ctx); #endif #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \ FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program case GL_PROGRAM_ERROR_STRING_NV: - if (ctx->Extensions.NV_fragment_program || - ctx->Extensions.ARB_fragment_program || - ctx->Extensions.NV_vertex_program || - ctx->Extensions.ARB_vertex_program) { + if (ctx->API == API_OPENGL && + (ctx->Extensions.NV_fragment_program || + ctx->Extensions.ARB_fragment_program || + ctx->Extensions.NV_vertex_program || + ctx->Extensions.ARB_vertex_program)) { return (const GLubyte *) ctx->Program.ErrorString; } - /* FALL-THROUGH */ + break; #endif default: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); - return (const GLubyte *) 0; + break; } + + _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); + return (const GLubyte *) 0; } |