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
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-27 03:29:40 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-27 03:29:40 +0400
commit72499b070ad5e66c9ee0f2df3f58f4e723339e04 (patch)
treee6b516a9cf8683acaf482169419f58d29622bb37 /source
parentf1d3982bf670890b686a200f95ec8008f6d28f23 (diff)
own recent commits caused crash with the grease pencil in camera view, always pass rv3d argument now.
also found a bug where hex_to_rgb could use un-initialized memory.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenlib/intern/math_color.c4
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c2
-rw-r--r--source/blender/editors/gpencil/gpencil_paint.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c3
4 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index 512086f0e17..ef1d5da56d8 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -194,6 +194,10 @@ void hex_to_rgb(char *hexcol, float *r, float *g, float *b)
CLAMP(*g, 0.0f, 1.0f);
CLAMP(*b, 0.0f, 1.0f);
}
+ else {
+ /* avoid using un-initialized vars */
+ *r= *g= *b= 0.0f;
+ }
}
void rgb_to_hsv(float r, float g, float b, float *lh, float *ls, float *lv)
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 27f2598d515..42ffefa6bd4 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -453,7 +453,7 @@ static int gp_camera_view_subrect(bContext *C, rctf *subrect)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
- ED_view3d_calc_camera_border(scene, ar, v3d, NULL, subrect, -1); /* negative shift */
+ ED_view3d_calc_camera_border(scene, ar, v3d, rv3d, subrect, -1); /* negative shift */
return 1;
}
}
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 2a4b583276e..f4da734473d 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1131,7 +1131,7 @@ static void gp_paint_initstroke (tGPsdata *p, short paintmode)
/* for camera view set the subrect */
if (rv3d->persp == RV3D_CAMOB) {
- ED_view3d_calc_camera_border(p->scene, p->ar, v3d, NULL, &p->subrect_data, -1); /* negative shift */
+ ED_view3d_calc_camera_border(p->scene, p->ar, v3d, rv3d, &p->subrect_data, -1); /* negative shift */
p->subrect= &p->subrect_data;
}
}
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index b134878624f..573951da4ca 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -876,9 +876,6 @@ void ED_view3d_calc_camera_border(Scene *scene, ARegion *ar, View3D *v3d, Region
float dx= 0.0f, dy= 0.0f;
view3d_viewborder_size_get(scene, ar, size);
-
- if (rv3d == NULL)
- rv3d = ar->regiondata;
size[0]= size[0]*zoomfac;
size[1]= size[1]*zoomfac;