mirror of
https://github.com/mpv-player/mpv
synced 2025-04-01 23:00:41 +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:
parent
75cab315ea
commit
202f14aa29
@ -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];
|
||||
|
Loading…
Reference in New Issue
Block a user