sdl12-compat: SDL_FreeYUVOverlay: Abandon any queued draw of the freed overlay.

From 514ad86a05ac68b316b43f08315a14ee070aafa5 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Wed, 23 Mar 2022 17:16:25 -0400
Subject: [PATCH] SDL_FreeYUVOverlay: Abandon any queued draw of the freed
 overlay.

Reference #176.
---
 src/SDL12_compat.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index 3e130e2..d9788a6 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -6630,6 +6630,9 @@ DECLSPEC void SDLCALL
 SDL_FreeYUVOverlay(SDL12_Overlay *overlay12)
 {
     if (overlay12) {
+        if (QueuedDisplayOverlay12 == overlay12) {
+            QueuedDisplayOverlay12 = NULL;
+        }
         SDL12_YUVData *hwdata = (SDL12_YUVData *) overlay12->hwdata;
         SDL20_DestroyTexture(hwdata->texture20);
         SDL20_free(hwdata->pixelbuf);