Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-10-06 16:04:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-10-06 16:04:09 +0400
commit4cc29110aa8c2f351f357859752342af28dc8fd5 (patch)
tree9356b57d4aab7b87540f02c86636e5b76b546124 /source/blender/render
parentb6a803fb368953bca1a7480694a7ab6d97439fad (diff)
fix writing past array bounds in imagewraposa().
also correct array sizes in othere areas.
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/include/texture.h2
-rw-r--r--source/blender/render/intern/source/imagetexture.c10
2 files changed, 6 insertions, 6 deletions
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)