mirror of
https://github.com/Genymobile/scrcpy.git
synced 2026-02-14 10:24:29 +01:00
Fix segfault with --no-video
Do not call SDL_RectToFRect() if geometry is NULL.
Bug introduced by 02989249f6.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user