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
2025-10-09 11:58:40 -07:00
parent 9cf7cdf23a
commit 23e3cbec20
3 changed files with 9 additions and 5 deletions

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;
}
}