Skip to content

Commit

Permalink
catch gl_buffer->map() returning nullptr (commaai#23411)
Browse files Browse the repository at this point in the history
  • Loading branch information
pd0wm authored Jan 5, 2022
1 parent a2e762e commit 8d80c01
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions selfdrive/ui/qt/widgets/cameraview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 8d80c01

Please sign in to comment.