[Mesa-dev] [PATCH 10/13] glsl: add missing null check in tfeedback_decl::init()

Matt Turner mattst88 at gmail.com
Wed Mar 12 15:23:44 PDT 2014


On Wed, Mar 12, 2014 at 2:11 PM, Juha-Pekka Heikkila
<juhapekka.heikkila at gmail.com> wrote:
> Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
> ---
>  src/glsl/link_varyings.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp
> index c925c00..226f012 100644
> --- a/src/glsl/link_varyings.cpp
> +++ b/src/glsl/link_varyings.cpp
> @@ -290,7 +290,8 @@ tfeedback_decl::init(struct gl_context *ctx, const void *mem_ctx,
>      * is converted from a float[8] to a vec4[2].
>      */
>     if (ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX].LowerClipDistance &&
> -       strcmp(this->var_name, "gl_ClipDistance") == 0) {
> +           this->var_name != NULL &&
> +           strcmp(this->var_name, "gl_ClipDistance") == 0) {
>        this->is_clip_distance_mesa = true;
>     }
>  }
> --
> 1.8.1.2

Huh. I don't know what the right thing to do if ralloc_strndup fails here.


More information about the mesa-dev mailing list