catch gl_buffer->map() returning nullptr (#23411)

pull/23416/head
Willem Melching 2022-01-05 14:23:57 +01:00 committed by GitHub
parent a2e762e0b9
commit 8d80c0107f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -291,6 +291,12 @@ void CameraViewWidget::vipcThread() {
if (VisionBuf *buf = vipc_client->recv(nullptr, 1000)) {
if (!Hardware::EON()) {
void *texture_buffer = gl_buffer->map(QOpenGLBuffer::WriteOnly);
if (texture_buffer == nullptr) {
LOGE("gl_buffer->map returned nullptr");
continue;
}
memcpy(texture_buffer, buf->addr, buf->len);
gl_buffer->unmap();