wined3d: Prevent possible integer overflow in buffer_invalidate_bo_range().

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-03-20 23:15:30 +01:00 committed by Alexandre Julliard
parent 654337e14d
commit 446ee50b90
1 changed files with 1 additions and 1 deletions

View File

@ -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;