Use safe way to get at a vector's data pointer
&std::vector<C>[0] is not guaranteed to not throw if the vector is empty. Better safe than sorry.
This commit is contained in:
parent
1b7ed5ed78
commit
520162f36a
8 changed files with 26 additions and 13 deletions
|
@ -374,7 +374,7 @@ struct WindowVXPrivate
|
|||
|
||||
base.vert.resize(count);
|
||||
|
||||
Vertex *vert = &base.vert.vertices[0];
|
||||
Vertex *vert = dataPtr(base.vert.vertices);
|
||||
size_t i = 0;
|
||||
|
||||
/* Stretched background */
|
||||
|
@ -518,7 +518,7 @@ struct WindowVXPrivate
|
|||
};
|
||||
|
||||
size_t i = 0;
|
||||
Vertex *vert = &ctrlVert.vertices[0];
|
||||
Vertex *vert = dataPtr(ctrlVert.vertices);
|
||||
|
||||
if (!nullOrDisposed(contents) && arrowsVisible)
|
||||
{
|
||||
|
@ -600,7 +600,7 @@ struct WindowVXPrivate
|
|||
quads += 1;
|
||||
|
||||
cursorVert.resize(quads);
|
||||
Vertex *vert = &cursorVert.vertices[0];
|
||||
Vertex *vert = dataPtr(cursorVert.vertices);
|
||||
size_t i = 0;
|
||||
|
||||
i += Quad::setTexPosRect(&vert[i*4], src.corners.tl, cornerPos.tl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue