- access to a meshs editmesh before the pointer was checked to be a mesh.
- uninitialized memory use in transform (not a problem practically but nice to quiet the error in valgrind).
This commit is contained in:
Campbell Barton 2012-03-08 01:22:49 +00:00
parent 52db32bb53
commit 081aa382ed
2 changed files with 15 additions and 11 deletions

@ -2711,12 +2711,14 @@ static int blend_from_shape_exec(bContext *C, wmOperator *op)
static EnumPropertyItem *shape_itemf(bContext *C, PointerRNA *UNUSED(ptr), PropertyRNA *UNUSED(prop), int *free)
{
Object *obedit = CTX_data_edit_object(C);
Mesh *me = (obedit) ? obedit->data : NULL;
BMEditMesh *em = (me) ? me->edit_btmesh : NULL;
BMEditMesh *em;
EnumPropertyItem *item = NULL;
int totitem = 0;
if (obedit && obedit->type == OB_MESH && CustomData_has_layer(&em->bm->vdata, CD_SHAPEKEY)) {
if ((obedit && obedit->type == OB_MESH) &&
(em = BMEdit_FromObject(obedit)) &&
CustomData_has_layer(&em->bm->vdata, CD_SHAPEKEY))
{
EnumPropertyItem tmp = {0, "", 0, "", ""};
int a;

@ -136,15 +136,13 @@ static void convertViewVec2D(View2D *v2d, float vec[3], int dx, int dy)
vec[2]= 0.0f;
}
void convertViewVec(TransInfo *t, float *vec, int dx, int dy)
void convertViewVec(TransInfo *t, float vec[3], int dx, int dy)
{
if(t->spacetype==SPACE_VIEW3D) {
if(t->ar->regiontype == RGN_TYPE_WINDOW) {
float mval_f[2];
mval_f[0]= dx;
mval_f[1]= dy;
ED_view3d_win_to_delta(t->ar, mval_f, vec);
}
if ((t->spacetype == SPACE_VIEW3D) && (t->ar->regiontype == RGN_TYPE_WINDOW)) {
float mval_f[2];
mval_f[0] = dx;
mval_f[1] = dy;
ED_view3d_win_to_delta(t->ar, mval_f, vec);
}
else if(t->spacetype==SPACE_IMAGE) {
float aspx, aspy;
@ -172,6 +170,10 @@ void convertViewVec(TransInfo *t, float *vec, int dx, int dy)
vec[1]= (v2d->cur.ymax-v2d->cur.ymin)*(dy)/divy;
vec[2]= 0.0f;
}
else {
printf("%s: called in an invalid context\n", __func__);
zero_v3(vec);
}
}
void projectIntView(TransInfo *t, float *vec, int *adr)