mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 15:32:59 +00:00
Merge pull request #11430 from valadaa48/drm_gfx_race_condition
drm_gfx: fix race conditions
This commit is contained in:
commit
6767f0f0c3
@ -210,7 +210,8 @@ static void drm_surface_free(void *data, struct drm_surface **sp)
|
||||
/* Changes surface ratio only without recreating the buffers etc. */
|
||||
static void drm_surface_set_aspect(struct drm_surface *surface, float aspect)
|
||||
{
|
||||
surface->aspect = aspect;
|
||||
if (surface)
|
||||
surface->aspect = aspect;
|
||||
}
|
||||
|
||||
static void drm_surface_setup(void *data, int src_width, int src_height,
|
||||
@ -922,7 +923,7 @@ static void drm_set_aspect_ratio (void *data, unsigned aspect_ratio_idx)
|
||||
/* Here we obtain the new aspect ratio. */
|
||||
float new_aspect = aspectratio_lut[aspect_ratio_idx].value;
|
||||
|
||||
if (_drmvars->current_aspect != new_aspect)
|
||||
if (_drmvars && _drmvars->current_aspect != new_aspect)
|
||||
{
|
||||
_drmvars->current_aspect = new_aspect;
|
||||
drm_surface_set_aspect(_drmvars->main_surface, new_aspect);
|
||||
|
Loading…
x
Reference in New Issue
Block a user