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
|
|
@ -265,7 +265,7 @@ createShadowSet()
|
|||
|
||||
/* Fill rects with half opacity black */
|
||||
uint32_t color = (0x80808080 & am);
|
||||
SDL_FillRects(surf, &rects[0], rects.size(), color);
|
||||
SDL_FillRects(surf, dataPtr(rects), rects.size(), color);
|
||||
|
||||
return surf;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue