diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/rigidbody.c | 12 | ||||
-rw-r--r-- | source/blender/imbuf/intern/cineon/logmemfile.c | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index bc0e8f2c728..f3276992381 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -288,18 +288,18 @@ static rbCollisionShape *rigidbody_get_shape_trimesh_from_mesh(Object *ob) for (i = 0; (i < totface) && (mface) && (mvert); i++, mface++) { /* add first triangle - verts 1,2,3 */ { - MVert *va = (IN_RANGE(mface->v1, 0, totvert)) ? (mvert + mface->v1) : (mvert); - MVert *vb = (IN_RANGE(mface->v2, 0, totvert)) ? (mvert + mface->v2) : (mvert); - MVert *vc = (IN_RANGE(mface->v3, 0, totvert)) ? (mvert + mface->v3) : (mvert); + MVert *va = (mface->v1 < totvert) ? (mvert + mface->v1) : (mvert); + MVert *vb = (mface->v2 < totvert) ? (mvert + mface->v2) : (mvert); + MVert *vc = (mface->v3 < totvert) ? (mvert + mface->v3) : (mvert); RB_trimesh_add_triangle(mdata, va->co, vb->co, vc->co); } /* add second triangle if needed - verts 1,3,4 */ if (mface->v4) { - MVert *va = (IN_RANGE(mface->v1, 0, totvert)) ? (mvert + mface->v1) : (mvert); - MVert *vb = (IN_RANGE(mface->v3, 0, totvert)) ? (mvert + mface->v3) : (mvert); - MVert *vc = (IN_RANGE(mface->v4, 0, totvert)) ? (mvert + mface->v4) : (mvert); + MVert *va = (mface->v1 < totvert) ? (mvert + mface->v1) : (mvert); + MVert *vb = (mface->v3 < totvert) ? (mvert + mface->v3) : (mvert); + MVert *vc = (mface->v4 < totvert) ? (mvert + mface->v4) : (mvert); RB_trimesh_add_triangle(mdata, va->co, vb->co, vc->co); } diff --git a/source/blender/imbuf/intern/cineon/logmemfile.c b/source/blender/imbuf/intern/cineon/logmemfile.c index 3914f6dc633..e52660faf66 100644 --- a/source/blender/imbuf/intern/cineon/logmemfile.c +++ b/source/blender/imbuf/intern/cineon/logmemfile.c @@ -50,7 +50,7 @@ int logimage_fseek(LogImageFile *logFile, intptr_t offset, int origin) } else if (origin == SEEK_CUR) { uintptr_t pos = (uintptr_t)logFile->memCursor - (uintptr_t)logFile->memBuffer; - if (pos + offset > logFile->memBufferSize || pos < 0) + if (pos + offset > logFile->memBufferSize) return 1; logFile->memCursor += offset; |