From 4adb6cac662941d92f3a6372cdced71d7ac83cbc Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 18 Sep 2017 19:10:14 +1000 Subject: [PATCH] Fix bad range checks --- source/blender/editors/gpencil/gpencil_edit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c index 58c5183ef61..b0acc174696 100644 --- a/source/blender/editors/gpencil/gpencil_edit.c +++ b/source/blender/editors/gpencil/gpencil_edit.c @@ -97,13 +97,13 @@ static void gpencil_verify_brush_type(bContext *C, int newmode) { case OB_MODE_GPENCIL_SCULPT: gset->flag &= ~GP_BRUSHEDIT_FLAG_WEIGHT_MODE; - if ((gset->brushtype < 0) && (gset->brushtype >= GP_EDITBRUSH_TYPE_WEIGHT)) { + if ((gset->brushtype < 0) || (gset->brushtype >= GP_EDITBRUSH_TYPE_WEIGHT)) { gset->brushtype = 0; } break; case OB_MODE_GPENCIL_WEIGHT: gset->flag |= GP_BRUSHEDIT_FLAG_WEIGHT_MODE; - if ((gset->weighttype < GP_EDITBRUSH_TYPE_WEIGHT) && (gset->weighttype >= TOT_GP_EDITBRUSH_TYPES)) { + if ((gset->weighttype < GP_EDITBRUSH_TYPE_WEIGHT) || (gset->weighttype >= TOT_GP_EDITBRUSH_TYPES)) { gset->weighttype = GP_EDITBRUSH_TYPE_WEIGHT; } break;