aboutsummaryrefslogtreecommitdiff
path: root/layers/swapchain.cpp
diff options
context:
space:
mode:
authorIan Elliott <ianelliott@google.com>2016-01-05 14:28:32 -0700
committerJon Ashburn <jon@lunarg.com>2016-01-06 12:23:10 -0700
commit87b69dc91ab37635dc0d3402fd1246dab3995a62 (patch)
treeec58361d09befd3b2d1cf76391aca06002faaeca /layers/swapchain.cpp
parent18a87c95d82b24560ab12c2605aad721416ef284 (diff)
downloadusermoji-87b69dc91ab37635dc0d3402fd1246dab3995a62.tar.xz
Swapchain: Change way p*Count is checked--make sure not bigger than should be.
Diffstat (limited to 'layers/swapchain.cpp')
-rw-r--r--layers/swapchain.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/layers/swapchain.cpp b/layers/swapchain.cpp
index 7c19c272..3441c955 100644
--- a/layers/swapchain.cpp
+++ b/layers/swapchain.cpp
@@ -1001,11 +1001,12 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfaceFormats
pSurfaceFormatCount) {
// Compare the preliminary value of *pSurfaceFormatCount with the
// value this time:
- if (*pSurfaceFormatCount != pPhysicalDevice->surfaceFormatCount) {
+ if (*pSurfaceFormatCount > pPhysicalDevice->surfaceFormatCount) {
LOG_ERROR_INVALID_COUNT(VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
physicalDevice,
"pSurfaceFormatCount",
"pSurfaceFormats",
+ *pSurfaceFormatCount,
pPhysicalDevice->surfaceFormatCount);
}
else if (*pSurfaceFormatCount > 0) {
@@ -1069,11 +1070,12 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetPhysicalDeviceSurfacePresent
pPresentModeCount) {
// Compare the preliminary value of *pPresentModeCount with the
// value this time:
- if (*pPresentModeCount != pPhysicalDevice->presentModeCount) {
+ if (*pPresentModeCount > pPhysicalDevice->presentModeCount) {
LOG_ERROR_INVALID_COUNT(VK_DEBUG_REPORT_OBJECT_TYPE_PHYSICAL_DEVICE_EXT,
physicalDevice,
"pPresentModeCount",
"pPresentModes",
+ *pPresentModeCount,
pPhysicalDevice->presentModeCount);
}
else if (*pPresentModeCount > 0) {
@@ -1579,11 +1581,12 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkGetSwapchainImagesKHR(
pSwapchainImageCount) {
// Compare the preliminary value of *pSwapchainImageCount with the
// value this time:
- if (*pSwapchainImageCount != pSwapchain->imageCount) {
+ if (*pSwapchainImageCount > pSwapchain->imageCount) {
LOG_ERROR_INVALID_COUNT(VK_DEBUG_REPORT_OBJECT_TYPE_DEVICE_EXT,
device,
"pSwapchainImageCount",
"pSwapchainImages",
+ *pSwapchainImageCount,
pSwapchain->imageCount);
}
else if (*pSwapchainImageCount > 0) {