r300: Add asserts to check for null pointer dereferences.
authorVinson Lee <vlee@vmware.com>
Sat, 27 Feb 2010 23:36:11 +0000 (15:36 -0800)
committerVinson Lee <vlee@vmware.com>
Sat, 27 Feb 2010 23:36:11 +0000 (15:36 -0800)
src/mesa/drivers/dri/r300/r300_vertprog.c

index 6a366b438b8468a8b11bc80d7223e81efb7fbf16..cbe4cb830473166e36d464c3c43551153abfe2a0 100644 (file)
@@ -79,6 +79,7 @@ static int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_progra
                        break;
                }
 
+               assert(src);
                dst[4*i] = src[0];
                dst[4*i + 1] = src[1];
                dst[4*i + 2] = src[2];
@@ -311,6 +312,7 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx)
                r300SelectAndTranslateFragmentShader(ctx);
        }
 
+       assert(r300->selected_fp);
        wanted_key.FpReads = r300->selected_fp->InputsRead;
        wanted_key.FogAttr = r300->selected_fp->fog_attr;
        wanted_key.WPosAttr = r300->selected_fp->wpos_attr;