anv: Improve the asserts in anv_buffer_get_range
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 2 Oct 2018 22:29:33 +0000 (17:29 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Sat, 27 Oct 2018 05:02:32 +0000 (00:02 -0500)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
src/intel/vulkan/anv_private.h

index 25e290ed112fd3b4c4d53a04399d2a120ec85cc9..d8a08d9d67fa8163f7f34682c0fac787e01586ad 100644 (file)
@@ -1705,7 +1705,8 @@ anv_buffer_get_range(struct anv_buffer *buffer, uint64_t offset, uint64_t range)
    if (range == VK_WHOLE_SIZE) {
       return buffer->size - offset;
    } else {
-      assert(range <= buffer->size);
+      assert(range + offset >= range);
+      assert(range + offset <= buffer->size);
       return range;
    }
 }