From d40be8404b1a492b86cda8a68d3a65d210ba966c Mon Sep 17 00:00:00 2001 From: Vencislav Atanasov Date: Fri, 25 Jul 2025 20:16:26 +0200 Subject: [PATCH] SDL: Prevent SDL_FreeSurface from freeing the LCD buffer In direct mode, the statically allocated Rockbox LCD framebuffer is used and should never be freed. Otherwise, ROCKBOX_VideoQuit takes care of freeing the dynamically allocated hidden buffer, used for scaling. This fixed hanging of Rockbox when quitting an SDL app. Change-Id: Ib9cd8c04cc0d2d6ccedaa582a5a85ef211d0273c --- apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c b/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c index 85c245ed9c..6bdd988667 100644 --- a/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c +++ b/apps/plugins/sdl/src/video/rockbox/SDL_rockboxvideo.c @@ -643,6 +643,7 @@ SDL_Surface *ROCKBOX_SetVideoMode(_THIS, SDL_Surface *current, this->hidden->h = current->h = height; current->pitch = current->w * (bpp / 8); current->pixels = this->hidden->direct ? lcd_fb : this->hidden->buffer; + current->flags |= SDL_PREALLOC; /* We're done */ return(current);