Skip to content

Commit

Permalink
Fix a segmentation fault caused by monitor_flush() when calling
Browse files Browse the repository at this point in the history
monitor_deinit().
  • Loading branch information
rockindy authored and amirgon committed Feb 3, 2020
1 parent d564c86 commit 49e5b65
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions driver/SDL/SDL_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ bool monitor_active(void)
*/
void monitor_flush(struct _disp_drv_t * disp_drv, const lv_area_t * area, lv_color_t * color_p)
{
/*Return if the area is out the screen*/
if(area->x2 < 0 || area->y2 < 0 || area->x1 > MONITOR_HOR_RES - 1 || area->y1 > MONITOR_VER_RES - 1) {
/*Return if the area is out the screen or the monitor is not active*/
if(area->x2 < 0 || area->y2 < 0 || area->x1 > MONITOR_HOR_RES - 1 || area->y1 > MONITOR_VER_RES - 1
|| !monitor_active()) {
lv_disp_flush_ready(disp_drv);
return;
}
Expand Down

0 comments on commit 49e5b65

Please sign in to comment.