Commit b878f00d by Jamie Madill Committed by Commit Bot

Fix warnings from size_t conversions.

These casts could result in overflow. Bug: chromium:842028 Change-Id: I998b638c58333a29f6bc9136ae3e81b90683cb72 Reviewed-on: https://chromium-review.googlesource.com/1057415Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 461b09a8
...@@ -92,7 +92,7 @@ gl::Error VertexBufferInterface::setBufferSize(unsigned int size) ...@@ -92,7 +92,7 @@ gl::Error VertexBufferInterface::setBufferSize(unsigned int size)
gl::ErrorOrResult<unsigned int> VertexBufferInterface::getSpaceRequired( gl::ErrorOrResult<unsigned int> VertexBufferInterface::getSpaceRequired(
const gl::VertexAttribute &attrib, const gl::VertexAttribute &attrib,
const gl::VertexBinding &binding, const gl::VertexBinding &binding,
GLsizei count, size_t count,
GLsizei instances) const GLsizei instances) const
{ {
unsigned int spaceRequired = 0; unsigned int spaceRequired = 0;
......
...@@ -93,7 +93,7 @@ class VertexBufferInterface : angle::NonCopyable ...@@ -93,7 +93,7 @@ class VertexBufferInterface : angle::NonCopyable
gl::ErrorOrResult<unsigned int> getSpaceRequired(const gl::VertexAttribute &attrib, gl::ErrorOrResult<unsigned int> getSpaceRequired(const gl::VertexAttribute &attrib,
const gl::VertexBinding &binding, const gl::VertexBinding &binding,
GLsizei count, size_t count,
GLsizei instances) const; GLsizei instances) const;
BufferFactoryD3D *const mFactory; BufferFactoryD3D *const mFactory;
VertexBuffer *mVertexBuffer; VertexBuffer *mVertexBuffer;
......
...@@ -3583,7 +3583,8 @@ gl::ErrorOrResult<unsigned int> Renderer11::getVertexSpaceRequired( ...@@ -3583,7 +3583,8 @@ gl::ErrorOrResult<unsigned int> Renderer11::getVertexSpaceRequired(
const unsigned int divisor = binding.getDivisor(); const unsigned int divisor = binding.getDivisor();
if (instances == 0 || divisor == 0) if (instances == 0 || divisor == 0)
{ {
elementCount = count; // This could be a clipped cast.
elementCount = gl::clampCast<unsigned int>(count);
} }
else else
{ {
......
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