Replace C++ VLAs with std::vector

This commit is contained in:
Cameron Gutman
2024-10-15 22:41:21 -05:00
parent 515db03fe5
commit 4af9623727
2 changed files with 10 additions and 6 deletions
@@ -1,5 +1,7 @@
#include <QString>
#include <vector>
// HACK: Include before vaapi.h to prevent conflicts with Xlib.h
#include <streaming/session.h>
@@ -573,9 +575,9 @@ VAAPIRenderer::isDirectRenderingSupported()
AVHWDeviceContext* deviceContext = (AVHWDeviceContext*)m_HwContext->data;
AVVAAPIDeviceContext* vaDeviceContext = (AVVAAPIDeviceContext*)deviceContext->hwctx;
VAEntrypoint entrypoints[vaMaxNumEntrypoints(vaDeviceContext->display)];
std::vector<VAEntrypoint> entrypoints(vaMaxNumEntrypoints(vaDeviceContext->display));
int entrypointCount;
VAStatus status = vaQueryConfigEntrypoints(vaDeviceContext->display, VAProfileNone, entrypoints, &entrypointCount);
VAStatus status = vaQueryConfigEntrypoints(vaDeviceContext->display, VAProfileNone, entrypoints.data(), &entrypointCount);
if (status == VA_STATUS_SUCCESS) {
for (int i = 0; i < entrypointCount; i++) {
// Without VAEntrypointVideoProc support, the driver will crash inside vaPutSurface()