[Mesa-dev] [PATCH 1/1] main: return 0 length when the queried program object's not linked

James Xiong james.xiong at intel.com
Fri Apr 27 14:47:15 UTC 2018


On Fri, 27 Apr 2018 12:32:09 +1000
Timothy Arceri <tarceri at itsqueeze.com> wrote:

> Reviewed-by: Timothy Arceri <tarceri at itsqueeze.com>
> 
> It would also be nice to have a piglit test for this case. I assume
> mesa probably crashes without this patch?
Thanks for the review. Yes there was a segmentation fault.
> 
> On 27/04/18 11:39, James Xiong wrote:
> > From: "Xiong, James" <james.xiong at intel.com>
> > 
> > Signed-off-by: Xiong, James <james.xiong at intel.com>
> > ---
> >   src/mesa/main/shaderapi.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> > index 44b18af..caa4254 100644
> > --- a/src/mesa/main/shaderapi.c
> > +++ b/src/mesa/main/shaderapi.c
> > @@ -837,7 +837,7 @@ get_programiv(struct gl_context *ctx, GLuint
> > program, GLenum pname, *params = shProg->BinaryRetreivableHint;
> >         return;
> >      case GL_PROGRAM_BINARY_LENGTH:
> > -      if (ctx->Const.NumProgramBinaryFormats == 0) {
> > +      if (ctx->Const.NumProgramBinaryFormats == 0
> > || !shProg->data->LinkStatus) { *params = 0;
> >         } else {
> >            _mesa_get_program_binary_length(ctx, shProg, params);
> >   



More information about the mesa-dev mailing list