mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-09 05:10:05 +02:00
libglvnd: A dereference ptr fix (being upstreamed), bump rev
This commit is contained in:
@@ -4,10 +4,11 @@ pipeline."
|
||||
HOMEPAGE="http://gitlab.freedesktop.org/glvnd/libglvnd"
|
||||
COPYRIGHT="2013, NVIDIA CORPORATION"
|
||||
LICENSE="MIT"
|
||||
REVISION="2"
|
||||
REVISION="3"
|
||||
SOURCE_URI="https://gitlab.freedesktop.org/glvnd/libglvnd/-/archive/v$portVersion/libglvnd-v$portVersion.tar.gz"
|
||||
SOURCE_DIR="libglvnd-v$portVersion"
|
||||
CHECKSUM_SHA256="2b6e15b06aafb4c0b6e2348124808cbd9b291c647299eaaba2e3202f51ff2f3d"
|
||||
PATCHES="libglvnd-${portVersion}.patchset"
|
||||
|
||||
ARCHITECTURES="?all"
|
||||
SECONDARY_ARCHITECTURES="?x86_gcc2 ?x86"
|
||||
|
||||
85
sys-libs/libglvnd/patches/libglvnd-1.7.0.patchset
Normal file
85
sys-libs/libglvnd/patches/libglvnd-1.7.0.patchset
Normal file
@@ -0,0 +1,85 @@
|
||||
From 459bf13875768bac1b93203ec5454808c9a7aae4 Mon Sep 17 00:00:00 2001
|
||||
From: Alexander von Gluck <alex@terarocket.io>
|
||||
Date: Tue, 9 Apr 2024 07:52:08 -0500
|
||||
Subject: [PATCH] Haiku: guard calls to fRenderer in HGL
|
||||
|
||||
* Prevents dereferencing fRenderer when an EGL renderer is not found
|
||||
---
|
||||
src/HGL/GLView.cpp | 18 ++++++++++++++++--
|
||||
1 file changed, 16 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/HGL/GLView.cpp b/src/HGL/GLView.cpp
|
||||
index 3719522..027a78c 100644
|
||||
--- a/src/HGL/GLView.cpp
|
||||
+++ b/src/HGL/GLView.cpp
|
||||
@@ -327,7 +327,11 @@ BGLView::~BGLView()
|
||||
void
|
||||
BGLView::LockGL()
|
||||
{
|
||||
+ if (fRenderer == NULL)
|
||||
+ return;
|
||||
+
|
||||
fDisplayLock.Lock();
|
||||
+
|
||||
if (fDisplayLock.CountLocks() == 1) {
|
||||
fRenderer->display->eglMakeCurrent(fRenderer->display->eglDpy, fRenderer->eglSurf,
|
||||
fRenderer->eglSurf, fRenderer->eglCtx);
|
||||
@@ -337,6 +341,9 @@ BGLView::LockGL()
|
||||
void
|
||||
BGLView::UnlockGL()
|
||||
{
|
||||
+ if (fRenderer == NULL)
|
||||
+ return;
|
||||
+
|
||||
thread_id lockerThread = fDisplayLock.LockingThread();
|
||||
thread_id callerThread = find_thread(NULL);
|
||||
|
||||
@@ -362,6 +369,8 @@ void
|
||||
BGLView::SwapBuffers(bool vSync)
|
||||
{
|
||||
_LockDraw();
|
||||
+ if (fRenderer == NULL)
|
||||
+ return;
|
||||
fRenderer->SwapBuffers();
|
||||
_UnlockDraw();
|
||||
}
|
||||
@@ -376,6 +385,8 @@ BGLView::EmbeddedView()
|
||||
void*
|
||||
BGLView::GetGLProcAddress(const char* procName)
|
||||
{
|
||||
+ if (fRenderer == NULL)
|
||||
+ return NULL;
|
||||
return (void*)fRenderer->display->eglGetProcAddress(procName);
|
||||
}
|
||||
|
||||
@@ -416,7 +427,7 @@ BGLView::Draw(BRect updateRect)
|
||||
{
|
||||
BRegion region(updateRect);
|
||||
PthreadMutexLocker lock(&fRenderer->fLock);
|
||||
- if (fRenderer->fBitmap.IsSet()) {
|
||||
+ if (fRenderer != NULL && fRenderer->fBitmap.IsSet()) {
|
||||
DrawBitmap(fRenderer->fBitmap.Get(), B_ORIGIN);
|
||||
region.Exclude(fRenderer->fBitmap->Bounds());
|
||||
}
|
||||
@@ -428,7 +439,7 @@ BGLView::AttachedToWindow()
|
||||
{
|
||||
BView::AttachedToWindow();
|
||||
|
||||
- {
|
||||
+ if (fRenderer != NULL) {
|
||||
PthreadMutexLocker lock(&fRenderer->fLock);
|
||||
fRenderer->width = Bounds().IntegerWidth() + 1;
|
||||
fRenderer->height = Bounds().IntegerHeight() + 1;
|
||||
@@ -462,6 +473,9 @@ BGLView::EnableDirectMode(bool enabled)
|
||||
void BGLView::FrameResized(float width, float height)
|
||||
{
|
||||
BView::FrameResized(width, height);
|
||||
+
|
||||
+ if (fRenderer == NULL)
|
||||
+ return;
|
||||
PthreadMutexLocker lock(&fRenderer->fLock);
|
||||
fRenderer->width = (uint32_t)width + 1;
|
||||
fRenderer->height = (uint32_t)height + 1;
|
||||
--
|
||||
2.43.2
|
||||
|
||||
Reference in New Issue
Block a user