mirror of
https://github.com/libretro/RetroArch.git
synced 2025-04-02 10:51:52 -04:00
runloop.c - create check_video_alive - try to prevent segfaults
at all costs
This commit is contained in:
parent
23640fd12e
commit
d98cd5a680
1 changed files with 10 additions and 1 deletions
11
runloop.c
11
runloop.c
|
@ -612,6 +612,15 @@ static int do_state_checks(
|
|||
return 0;
|
||||
}
|
||||
|
||||
static inline bool check_video_alive(void)
|
||||
{
|
||||
if (!driver.video || !driver.video_data)
|
||||
return false;
|
||||
if (!driver.video->alive(driver.video_data))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* time_to_exit:
|
||||
* @input : input sample for this frame
|
||||
|
@ -636,7 +645,7 @@ static inline int time_to_exit(retro_input_t input)
|
|||
|| (g_extern.max_frames && g_extern.frame_count >=
|
||||
g_extern.max_frames)
|
||||
|| (g_extern.bsv.movie_end && g_extern.bsv.eof_exit)
|
||||
|| !driver.video->alive(driver.video_data)
|
||||
|| check_video_alive()
|
||||
)
|
||||
return 1;
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue