Only call clipboard callbacks with mime types they expect

Also clarified that returning NULL from a callback sends zero length data to the receiver, which should be able to handle that.

Fixes https://github.com/libsdl-org/SDL/issues/9586
This commit is contained in:
Sam Lantinga committed 2025-10-09 12:20:19 -07:00
1 parent 9cf7cdf23a
commit 23e3cbec20
3 files changed
+9 -5

No files matched your search

+1
View File
@@ -34,6 +34,7 @@ static const void *ClipboardDataCallback(void *userdata, const char *mime_type,
*size = icon_png_len;
return icon_png;
} else {
SDL_Log("Called with unexpected mime type: %s", mime_type);
return NULL;
}
}