diff options
Diffstat (limited to 'intern/ghost/intern/GHOST_SystemWin32.cpp')
-rw-r--r-- | intern/ghost/intern/GHOST_SystemWin32.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_SystemWin32.cpp b/intern/ghost/intern/GHOST_SystemWin32.cpp index f5c7c08ebfe..7bc20d38739 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cpp +++ b/intern/ghost/intern/GHOST_SystemWin32.cpp @@ -917,8 +917,12 @@ GHOST_TUns8* GHOST_SystemWin32::getClipboard(int flag) const char *buffer; char *temp_buff; - if ( OpenClipboard(NULL) ) { + if ( IsClipboardFormatAvailable(CF_TEXT) && OpenClipboard(NULL) ) { HANDLE hData = GetClipboardData( CF_TEXT ); + if (hData == NULL) { + CloseClipboard(); + return NULL; + } buffer = (char*)GlobalLock( hData ); temp_buff = (char*) malloc(strlen(buffer)+1); |