Commit 446ee50b authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Prevent possible integer overflow in buffer_invalidate_bo_range().

parent 654337e1
......@@ -47,7 +47,7 @@ static void buffer_invalidate_bo_range(struct wined3d_buffer *buffer, unsigned i
if (!offset && (!size || size == buffer->resource.size))
goto invalidate_all;
if (offset > buffer->resource.size || offset + size > buffer->resource.size)
if (offset > buffer->resource.size || size > buffer->resource.size - offset)
{
WARN("Invalid range specified, invalidating entire buffer.\n");
goto invalidate_all;
......
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