gl/context/wgl: Add missing NULL init
authorSeungha Yang <seungha@centricular.com>
Sat, 3 Jul 2021 10:36:06 +0000 (19:36 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Sat, 3 Jul 2021 11:40:25 +0000 (11:40 +0000)
The value of uninitialized local variable is varying depending
on compiler and not guaranteed to be NULL initialized.
That results in pointing random address instead of expected function pointer.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/1222>

gst-libs/gst/gl/wgl/gstglcontext_wgl.c

index b24f46c..200304e 100644 (file)
@@ -493,7 +493,7 @@ load_opengl_dll_module (gpointer user_data)
 gpointer
 gst_gl_context_wgl_get_proc_address (GstGLAPI gl_api, const gchar * name)
 {
-  gpointer result;
+  gpointer result = NULL;
 
   if (gl_api & (GST_GL_API_OPENGL | GST_GL_API_OPENGL3)) {
     g_once (&module_opengl_dll_gonce, load_opengl_dll_module, NULL);