[WIN32K:NTUSER]
[reactos.git] / reactos / win32ss / user / ntuser / clipboard.c
index e2a93e1..068dc5d 100644 (file)
@@ -448,9 +448,14 @@ UserEnumClipboardFormats(UINT fmt)
     {
         /* Return next format */
         pElement = IntGetFormatElement(pWinStaObj, fmt);
-        ++pElement;
-        if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats])
-            Ret = pElement->fmt;
+        if (pElement != NULL)
+        {
+            ++pElement;
+            if (pElement < &pWinStaObj->pClipBase[pWinStaObj->cNumClipFormats])
+            {
+                Ret = pElement->fmt;
+            }
+        }
     }
 
 cleanup: