[gnome-remote-desktop] hwaccel-nvidia: Don't dereference NULL pointer in assertion
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-remote-desktop] hwaccel-nvidia: Don't dereference NULL pointer in assertion
- Date: Fri, 6 May 2022 15:45:48 +0000 (UTC)
commit 8a68b5d53756ff3a117bdd125a42c2a47beb2efe
Author: Pascal Nowack <Pascal Nowack gmx de>
Date: Sat Mar 5 11:45:18 2022 +0100
hwaccel-nvidia: Don't dereference NULL pointer in assertion
Asserting that the hash table with the encode sessions is empty can
only happen, when the hash table still exists.
Since the dispose() method can run multiple times, this requires an
additional check to not run into a crash.
So, add it.
src/grd-hwaccel-nvidia.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/grd-hwaccel-nvidia.c b/src/grd-hwaccel-nvidia.c
index cd9abf66..1efb472a 100644
--- a/src/grd-hwaccel-nvidia.c
+++ b/src/grd-hwaccel-nvidia.c
@@ -882,7 +882,8 @@ grd_hwaccel_nvidia_dispose (GObject *object)
nvenc_free_functions (&hwaccel_nvidia->nvenc_funcs);
cuda_free_functions (&hwaccel_nvidia->cuda_funcs);
- g_assert (g_hash_table_size (hwaccel_nvidia->encode_sessions) == 0);
+ g_assert (!hwaccel_nvidia->encode_sessions ||
+ g_hash_table_size (hwaccel_nvidia->encode_sessions) == 0);
g_clear_pointer (&hwaccel_nvidia->encode_sessions, g_hash_table_destroy);
G_OBJECT_CLASS (grd_hwaccel_nvidia_parent_class)->dispose (object);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]