Commit dad07a23 authored by loring's avatar loring

fix out of bounds write resulting from off by 1 index


git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@26748 18c085ea-50e0-402c-830e-de6fd14e8384
parent 9c827ba6
......@@ -553,7 +553,6 @@ ColorControlPointList::CreateNode(DataNode *parentNode, bool completeSave, bool
node->AddNode(new DataNode("category", categoryName));
}
// Add the node to the parent node.
if(addToParent || forceAdd)
parentNode->AddNode(node);
......@@ -1511,8 +1510,8 @@ ColorControlPointList::GetColors(unsigned char *rgb,
c2_g++;
c2_b++;
c2_a++;
color_start_i = int(c1_pos[0] * float(ncolors));
color_end_i = int(c2_pos[0] * float(ncolors));
color_start_i = int(c1_pos[0] * float(ncolors - 1));
color_end_i = int(c2_pos[0] * float(ncolors - 1));
color_range = color_end_i - color_start_i;
if(color_range > 1)
......
......@@ -368,8 +368,8 @@ ColorControlPointList::GetColors(unsigned char *rgb,
c2_g++;
c2_b++;
c2_a++;
color_start_i = int(c1_pos[0] * float(ncolors));
color_end_i = int(c2_pos[0] * float(ncolors));
color_start_i = int(c1_pos[0] * float(ncolors - 1));
color_end_i = int(c2_pos[0] * float(ncolors - 1));
color_range = color_end_i - color_start_i;
if(color_range > 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment