diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-06 16:04:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-06 16:04:09 +0400 |
commit | 4cc29110aa8c2f351f357859752342af28dc8fd5 (patch) | |
tree | 9356b57d4aab7b87540f02c86636e5b76b546124 /source/blender | |
parent | b6a803fb368953bca1a7480694a7ab6d97439fad (diff) |
fix writing past array bounds in imagewraposa().
also correct array sizes in othere areas.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenlib/intern/math_vector_inline.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_rip.c | 2 | ||||
-rw-r--r-- | source/blender/editors/mesh/editmesh_select.c | 2 | ||||
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/drawobject.c | 4 | ||||
-rw-r--r-- | source/blender/render/intern/include/texture.h | 2 | ||||
-rw-r--r-- | source/blender/render/intern/source/imagetexture.c | 10 |
7 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/blenlib/intern/math_vector_inline.c b/source/blender/blenlib/intern/math_vector_inline.c index c409e536b45..2cfe999e032 100644 --- a/source/blender/blenlib/intern/math_vector_inline.c +++ b/source/blender/blenlib/intern/math_vector_inline.c @@ -689,7 +689,7 @@ MINLINE void normal_float_to_short_v3(short out[3], const float in[3]) /********************************* Comparison ********************************/ -MINLINE int is_zero_v2(const float v[3]) +MINLINE int is_zero_v2(const float v[2]) { return (v[0] == 0 && v[1] == 0); } diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 53b877f2a6e..001d584416f 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -57,7 +57,7 @@ /* helper to find edge for edge_rip */ static float edbm_rip_rip_edgedist(ARegion *ar, float mat[][4], - const float co1[3], const float co2[2], const float mvalf[2]) + const float co1[3], const float co2[3], const float mvalf[2]) { float vec1[3], vec2[3]; diff --git a/source/blender/editors/mesh/editmesh_select.c b/source/blender/editors/mesh/editmesh_select.c index 801c9382c26..da87767e492 100644 --- a/source/blender/editors/mesh/editmesh_select.c +++ b/source/blender/editors/mesh/editmesh_select.c @@ -448,7 +448,7 @@ BMVert *EDBM_vert_find_nearest(ViewContext *vc, int *dist, short sel, short stri } /* returns labda for closest distance v1 to line-piece v2 - v3 */ -float labda_PdistVL2Dfl(const float v1[3], const float v2[3], const float v3[3]) +float labda_PdistVL2Dfl(const float v1[2], const float v2[2], const float v3[2]) { float rc[2], len; diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 29a59651cf7..b3679516fff 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -201,7 +201,7 @@ static void imapaint_project(Object *ob, float model[][4], float proj[][4], cons static void imapaint_tri_weights(Object *ob, const float v1[3], const float v2[3], const float v3[3], - const float co[3], float w[3]) + const float co[2], float w[3]) { float pv1[4], pv2[4], pv3[4], h[3], divw; float model[4][4], proj[4][4], wmat[3][3], invwmat[3][3]; diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index a6f4527cf98..84a69b811ca 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5945,8 +5945,8 @@ static int drawmball(Scene *scene, View3D *v3d, RegionView3D *rv3d, Base *base, if (mb->editelems) { if ((G.f & G_PICKSEL) == 0) { - unsigned char wire_col[3]; - UI_GetThemeColor3ubv(TH_WIRE, wire_col); + unsigned char wire_col[4]; + UI_GetThemeColor4ubv(TH_WIRE, wire_col); glColor3ubv(wire_col); drawDispList(scene, v3d, rv3d, base, dt, dflag, wire_col); diff --git a/source/blender/render/intern/include/texture.h b/source/blender/render/intern/include/texture.h index e8f171fe383..4b9fa2d2042 100644 --- a/source/blender/render/intern/include/texture.h +++ b/source/blender/render/intern/include/texture.h @@ -76,7 +76,7 @@ void render_realtime_texture(struct ShadeInput *shi, struct Image *ima); /* imagetexture.h */ -int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[3], const float dyt[3], struct TexResult *texres); +int imagewraposa(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], const float dxt[2], const float dyt[2], struct TexResult *texres); int imagewrap(struct Tex *tex, struct Image *ima, struct ImBuf *ibuf, const float texvec[3], struct TexResult *texres); void image_sample(struct Image *ima, float fx, float fy, float dx, float dy, float result[4]); diff --git a/source/blender/render/intern/source/imagetexture.c b/source/blender/render/intern/source/imagetexture.c index f62ed909094..6c86f2a2999 100644 --- a/source/blender/render/intern/source/imagetexture.c +++ b/source/blender/render/intern/source/imagetexture.c @@ -1018,7 +1018,7 @@ static void image_mipmap_test(Tex *tex, ImBuf *ibuf) } -static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], float dxt[3], float dyt[3], TexResult *texres) +static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], float dxt[2], float dyt[2], TexResult *texres) { TexResult texr; float fx, fy, minx, maxx, miny, maxy; @@ -1412,17 +1412,17 @@ static int imagewraposa_aniso(Tex *tex, Image *ima, ImBuf *ibuf, const float tex } -int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const float DXT[3], const float DYT[3], TexResult *texres) +int imagewraposa(Tex *tex, Image *ima, ImBuf *ibuf, const float texvec[3], const float DXT[2], const float DYT[2], TexResult *texres) { TexResult texr; - float fx, fy, minx, maxx, miny, maxy, dx, dy, dxt[3], dyt[3]; + float fx, fy, minx, maxx, miny, maxy, dx, dy, dxt[2], dyt[2]; float maxd, pixsize, val1, val2, val3; int curmap, retval, imaprepeat, imapextend; /* TXF: since dxt/dyt might be modified here and since they might be needed after imagewraposa() call, * make a local copy here so that original vecs remain untouched */ - copy_v3_v3(dxt, DXT); - copy_v3_v3(dyt, DYT); + copy_v2_v2(dxt, DXT); + copy_v2_v2(dyt, DYT); /* anisotropic filtering */ if (tex->texfilter != TXF_BOX) |