diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-15 23:17:16 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2015-06-15 23:17:16 +0300 |
commit | 6c23497185b90d6b7b2485f4468a25db24fa6c21 (patch) | |
tree | d897e8c06ad6243df65cf2b9c375b12a0cee603b /source/blender/blenkernel | |
parent | 1c707a239258996e4f5a5873517ff34564eaf8da (diff) |
Fix T45086: Crash showing scopes
Was a rounding issue, which was previously solved by quite simple check.
Well, let's do the same check again :)
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/colortools.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 9cce9294bb4..3c70bd4eeb5 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -1135,7 +1135,8 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings * #endif const float *rf = NULL; const unsigned char *rc = NULL; - const bool do_sample_line = (y % rows_per_sample_line) == 0; + const int savedlines = y / rows_per_sample_line; + const bool do_sample_line = (savedlines < scopes->sample_lines) && (y % rows_per_sample_line) == 0; float min[3] = { FLT_MAX, FLT_MAX, FLT_MAX}, max[3] = {-FLT_MAX, -FLT_MAX, -FLT_MAX}; int x, c; @@ -1183,7 +1184,6 @@ void scopes_update(Scopes *scopes, ImBuf *ibuf, const ColorManagedViewSettings * /* save sample if needed */ if (do_sample_line) { const float fx = (float)x / (float)ibuf->x; - const int savedlines = y / rows_per_sample_line; const int idx = 2 * (ibuf->x * savedlines + x); save_sample_line(scopes, idx, fx, rgba, ycc); } |