obs-studio/libobs-opengl
Barnabás Pőcze dee7ef8512 libobs-opengl: Do not close X11 platform display on error
The platform display is not owned by libobs, it should not
be closed. Doing so results in heap use-after-frees when
Qt components try to use it while trying to show
a message box about the failure:

  info: Initializing OpenGL...
  error: Failed to initialize EGL: EGL_BAD_ACCESS
  error: Failed to create context!
  error: device_create (GL) failed
  error: Failed to initialize video.  Your GPU may not be supported, or your graphics drivers may need to be updated.
  =================================================================
  ==2320345==ERROR: AddressSanitizer: heap-use-after-free on address 0x621000018668 at pc 0x7fcb75e20d6e bp 0x7ffe88d0e910 sp 0x7ffe88d0e900
  READ of size 8 at 0x621000018668 thread T0
      0 0x7fcb75e20d6d in XInternAtom /.../libx11/src/IntAtom.c:175
      1 0x7fcb6bf5edfd in Kvantum::ThemeConfig::getCompositeSpec()
      2 0x7fcb6bf0eb19 in Kvantum::Style::setSurfaceFormat(QWidget*) const
      3 0x7fcb6bf11bae in Kvantum::Style::styleHint(QStyle::StyleHint, QStyleOption const*, QWidget const*, QStyleHintReturn*) const
      4 0x5585cbce70b8 in OBSIgnoreWheelProxyStyle::styleHint(QStyle::StyleHint, QStyleOption const*, QWidget const*, QStyleHintReturn*) const /.../obs-studio/UI/obs-proxy-style.cpp:88
      5 0x7fcb85826515  (/usr/lib/libQt6Widgets.so.6+0x226515)
      6 0x7fcb859dbf1d  (/usr/lib/libQt6Widgets.so.6+0x3dbf1d)
      7 0x7fcb859dc5f0 in QMessageBox::QMessageBox(...)
      8 0x7fcb859dc6b1  (/usr/lib/libQt6Widgets.so.6+0x3dc6b1)
      9 0x5585cbd2fb31 in OBSErrorBoxva /.../obs-studio/UI/qt-wrappers.cpp:48
      10 0x5585cbd2fd34 in OBSErrorBox(QWidget*, char const*, ...) /.../obs-studio/UI/qt-wrappers.cpp:55
      11 0x5585cbcc3f36 in run_program /.../obs-studio/UI/obs-app.cpp:2475
      12 0x5585cbcc52b4 in main /.../obs-studio/UI/obs-app.cpp:3358
      13 0x7fcb82e3c28f  (/usr/lib/libc.so.6+0x2328f)
      14 0x7fcb82e3c349 in __libc_start_main
      15 0x5585cbbd2f54 in _start

Fixes: 137966e01f ("libobs-opengl: Try to use the platform display if available")
2023-01-25 13:56:50 -05:00
..
.gitignore first commit 2013-09-30 19:37:13 -07:00
CMakeLists.txt Drop GLX renderer 2022-05-24 14:31:48 -03:00
gl-cocoa.m libobs,libobs-opengl,obs-ffmpeg-mux: Calm deprecation warnings on *nix 2023-01-19 13:08:46 -05:00
gl-egl-common.c libobs-opengl: Replace OBS_UNUSED with UNUSED_PARAMETER 2022-07-20 08:22:08 +02:00
gl-egl-common.h libobs-opengl: Add create_texture_from_pixmap for EGL 2022-05-15 09:08:53 -03:00
gl-helpers.c libobs: Add support for volume textures 2019-12-15 14:38:26 -08:00
gl-helpers.h libobs-opengl: Fix border color support on GL textures 2022-01-12 06:35:16 -08:00
gl-indexbuffer.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
gl-nix.c libobs-opengl: Drop gl pointers on device_leave_context 2023-01-14 15:33:18 -08:00
gl-nix.h libobs-opengl: Add create_texture_from_pixmap for EGL 2022-05-15 09:08:53 -03:00
gl-shader.c UI,libobs,libobs-opengl,obs-ffmpeg: Remove unneeded cast in switches 2023-01-16 11:52:26 +01:00
gl-shaderparser.c libobs-opengl: SRGB-safe GLSL path for raw loads 2021-01-19 12:24:36 -08:00
gl-shaderparser.h libobs-opengl: Add sincos to HLSL->GLSL transpile 2020-04-07 23:59:14 -07:00
gl-stagesurf.c Revert "libobs-opengl: Use PBO in device_stage_texture on macOS" 2022-01-01 18:38:33 -08:00
gl-subsystem.c libobs: Cleanup unused-parameters 2022-07-19 11:01:00 -04:00
gl-subsystem.h libobs/graphics: Add color space support 2022-03-23 22:35:26 -07:00
gl-texture2d.c libobs: Add support for volume textures 2019-12-15 14:38:26 -08:00
gl-texture3d.c libobs-opengl: Fix volume texture leak 2020-01-04 01:28:16 -08:00
gl-texturecube.c libobs: Add support for volume textures 2019-12-15 14:38:26 -08:00
gl-vertexbuffer.c libobs-opengl: Empty VAO 2019-06-24 23:13:04 -05:00
gl-wayland-egl.c libobs-opengl: Replace OBS_UNUSED with UNUSED_PARAMETER 2022-07-20 08:22:08 +02:00
gl-wayland-egl.h libobs-opengl: Introduce an EGL/Wayland renderer 2021-02-09 09:39:17 -03:00
gl-windows.c libobs-d3d11,libobs-opengl,plugins: Remove unneeded cast in switches 2023-01-16 11:52:26 +01:00
gl-x11-egl.c libobs-opengl: Do not close X11 platform display on error 2023-01-25 13:56:50 -05:00
gl-x11-egl.h libobs-opengl: Introduce the X11/EGL winsys 2021-02-01 19:03:14 -03:00
gl-zstencil.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00