mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
vo_opengl: hwdec_rpi: fix NULL pointer deref in certain cases
If a client API user provides the MPGetNativeDisplay callback, but returns NULL for "MPV_RPI_WINDOW", this would crash.
This commit is contained in:
@@ -136,7 +136,9 @@ static void update_overlay(struct gl_hwdec *hw, bool check_window_only)
|
||||
|
||||
int defs[4] = {0, 0, 0, 0};
|
||||
int *z =
|
||||
gl->MPGetNativeDisplay ? gl->MPGetNativeDisplay("MPV_RPI_WINDOW") : defs;
|
||||
gl->MPGetNativeDisplay ? gl->MPGetNativeDisplay("MPV_RPI_WINDOW") : NULL;
|
||||
if (!z)
|
||||
z = defs;
|
||||
|
||||
// As documented in the libmpv openglcb headers.
|
||||
int display = z[0];
|
||||
|
||||
Reference in New Issue
Block a user