Fix frame leak on pending frame update

The previous pending frame was not unreferenced before referencing the
new one, causing frames to leak whenever a texture update failed
(typically on Windows when the window is minimized with D3D9).

Refs 6298ef095f
Fixes #4297 <https://github.com/Genymobile/scrcpy/issues/4297>
Fixes #6357 <https://github.com/Genymobile/scrcpy/issues/6357>
This commit is contained in:
Romain Vimont 2025-09-23 20:18:26 +02:00
commit be21e43be5

View file

@ -170,6 +170,7 @@ sc_display_set_pending_frame(struct sc_display *display, const AVFrame *frame) {
} }
} }
av_frame_unref(display->pending.frame);
int r = av_frame_ref(display->pending.frame, frame); int r = av_frame_ref(display->pending.frame, frame);
if (r) { if (r) {
LOGE("Could not ref frame: %d", r); LOGE("Could not ref frame: %d", r);