[OLE32] Do not crash on an invalid / empty clipboard.
authorMark Jansen <mark.jansen@reactos.org>
Fri, 18 Aug 2017 17:18:46 +0000 (17:18 +0000)
committerMark Jansen <mark.jansen@reactos.org>
Fri, 18 Aug 2017 17:18:46 +0000 (17:18 +0000)
CORE-12302

svn path=/trunk/; revision=75617

reactos/dll/win32/ole32/clipboard.c

index 6ea2d4a..8f526c7 100644 (file)
@@ -2018,6 +2018,10 @@ static LRESULT CALLBACK clipbrd_wndproc(HWND hwnd, UINT message, WPARAM wparam,
     {
     case WM_RENDERFORMAT:
     {
     {
     case WM_RENDERFORMAT:
     {
+#ifdef __REACTOS__
+    if (clipbrd->cached_enum)
+    {
+#endif
         UINT cf = wparam;
         ole_priv_data_entry *entry;
 
         UINT cf = wparam;
         ole_priv_data_entry *entry;
 
@@ -2026,7 +2030,9 @@ static LRESULT CALLBACK clipbrd_wndproc(HWND hwnd, UINT message, WPARAM wparam,
 
         if(entry)
             render_format(clipbrd->src_data, &entry->fmtetc);
 
         if(entry)
             render_format(clipbrd->src_data, &entry->fmtetc);
-
+#ifdef __REACTOS__
+    }
+#endif
         break;
     }
 
         break;
     }