Skip to content

Display and control your Android device

Fix segfault with --no-video

Romain Vimontfde02a7dfa3b
diff --git a/app/src/display.c b/app/src/display.c
index 3050966c..44603696 100644
--- a/app/src/display.c
+++ b/app/src/display.c
@@ -389,8 +389,12 @@ sc_display_render(struct sc_display *display, const SDL_Rect *geometry,
if (orientation == SC_ORIENTATION_0) {
SDL_FRect frect;
- SDL_RectToFRect(geometry, &frect);
- bool ok = SDL_RenderTexture(renderer, texture, NULL, &frect);
+ SDL_FRect *fgeometry = NULL;
+ if (geometry) {
+ SDL_RectToFRect(geometry, &frect);
+ fgeometry = &frect;
+ }
+ bool ok = SDL_RenderTexture(renderer, texture, NULL, fgeometry);
if (!ok) {
LOGE("Could not render texture: %s", SDL_GetError());
return SC_DISPLAY_RESULT_ERROR;