codechecker: Add assert for implicit condition

Since memReq is initialized inside the loop, codechecker
complained that we might use uninitialized data if count == 0.
So we assert that this is not the case to get rid of the
warning.

Change-Id: I82152942d2bb61723e9e41489c87bfde9f8bec15
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2021-06-17 07:47:13 +02:00
parent e9cdcc7cb3
commit 30f1f02cf7

View File

@ -1330,6 +1330,7 @@ bool QVulkanWindowPrivate::createTransientImage(VkFormat format,
VkMemoryRequirements memReq;
VkResult err;
Q_ASSERT(count > 0);
for (int i = 0; i < count; ++i) {
VkImageCreateInfo imgInfo;
memset(&imgInfo, 0, sizeof(imgInfo));