From 8d80c0107f5d1cd2ba2b5a37f297d3ae8e3b02f3 Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Wed, 5 Jan 2022 14:23:57 +0100 Subject: [PATCH] catch gl_buffer->map() returning nullptr (#23411) --- selfdrive/ui/qt/widgets/cameraview.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/selfdrive/ui/qt/widgets/cameraview.cc b/selfdrive/ui/qt/widgets/cameraview.cc index 289f61afe0cf76..90501227659368 100644 --- a/selfdrive/ui/qt/widgets/cameraview.cc +++ b/selfdrive/ui/qt/widgets/cameraview.cc @@ -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();