SDL: do not segfault if init fails

This commit is contained in:
Martin Pulec
2015-06-22 17:30:18 +02:00
parent 5c8946d5a9
commit e4ec80f648

View File

@@ -445,6 +445,7 @@ static int display_sdl_reconfigure_real(void *state, struct video_desc desc)
s->current_display_desc = desc;
if (!update_size(s, desc.width, desc.height)) {
memset(&s->current_display_desc, 0, sizeof s->current_display_desc);
return FALSE;
}
if (window_title) {
@@ -461,6 +462,7 @@ static int display_sdl_reconfigure_real(void *state, struct video_desc desc)
FOURCC_UYVY : FOURCC_YUYV, s->sdl_screen);
if (s->yuv_image == NULL) {
printf("SDL_overlay initialization failed.\n");
memset(&s->current_display_desc, 0, sizeof s->current_display_desc);
return FALSE;
}
}