Răsfoiți Sursa

Fixed a rare crash on Raspberry Pi when creating a window

(cherry picked from commit 0dbd9d2a65634cae4555b4d47771009b3c9fcae4)
Sam Lantinga 15 ore în urmă
părinte
comite
257de23efc
1 a modificat fișierele cu 8 adăugiri și 0 ștergeri
  1. 8 0
      src/video/wayland/SDL_waylanddatamanager.c

+ 8 - 0
src/video/wayland/SDL_waylanddatamanager.c

@@ -470,6 +470,10 @@ void Wayland_data_offer_notify_from_mimes(SDL_WaylandDataOffer *offer, bool chec
         // Do a first pass to compute allocation size.
         SDL_MimeDataList *item = NULL;
         wl_list_for_each(item, &offer->mimes, link) {
+            if (!item->mime_type) {
+                continue;
+            }
+
             // If origin metadata is found, queue a check and wait for confirmation that this offer isn't recursive.
             if (check_origin && SDL_strcmp(item->mime_type, SDL_DATA_ORIGIN_MIME) == 0) {
                 Wayland_data_offer_check_source(offer, item->mime_type);
@@ -493,6 +497,10 @@ void Wayland_data_offer_notify_from_mimes(SDL_WaylandDataOffer *offer, bool chec
         item = NULL;
         int i = 0;
         wl_list_for_each(item, &offer->mimes, link) {
+            if (!item->mime_type) {
+                continue;
+            }
+
             new_mime_types[i] = strPtr;
             strPtr = stpcpy(strPtr, item->mime_type) + 1;
             i++;