summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRay <[email protected]>2022-11-05 00:31:13 +0100
committerRay <[email protected]>2022-11-05 00:31:13 +0100
commitca6f58eed1dfb74d93fb5ffe222cee61c20dde80 (patch)
tree474a9345cffdd93edf2b560ebd9581ac19c70cdd
parentdbdfad7ace061931da701070c5c7fbe772c57725 (diff)
downloadraylib-ca6f58eed1dfb74d93fb5ffe222cee61c20dde80.tar.gz
raylib-ca6f58eed1dfb74d93fb5ffe222cee61c20dde80.zip
Update rcore.c
-rw-r--r--src/rcore.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/rcore.c b/src/rcore.c
index b75b53b4..54feb38b 100644
--- a/src/rcore.c
+++ b/src/rcore.c
@@ -1937,18 +1937,6 @@ void SetClipboardText(const char *text)
#endif
}
-// Enable waiting for events on EndDrawing(), no automatic event polling
-void EnableEventWaiting(void)
-{
- CORE.Window.eventWaiting = true;
-}
-
-// Disable waiting for events on EndDrawing(), automatic events polling
-void DisableEventWaiting(void)
-{
- CORE.Window.eventWaiting = false;
-}
-
// Get clipboard text content
// NOTE: returned string is allocated and freed by GLFW
const char *GetClipboardText(void)
@@ -1962,6 +1950,18 @@ const char *GetClipboardText(void)
return NULL;
}
+// Enable waiting for events on EndDrawing(), no automatic event polling
+void EnableEventWaiting(void)
+{
+ CORE.Window.eventWaiting = true;
+}
+
+// Disable waiting for events on EndDrawing(), automatic events polling
+void DisableEventWaiting(void)
+{
+ CORE.Window.eventWaiting = false;
+}
+
// Show mouse cursor
void ShowCursor(void)
{
@@ -3288,6 +3288,9 @@ unsigned char *DecompressData(const unsigned char *compData, int compDataSize, i
// Decompress data from a valid DEFLATE stream
data = RL_CALLOC(MAX_DECOMPRESSION_SIZE*1024*1024, 1);
int length = sinflate(data, MAX_DECOMPRESSION_SIZE*1024*1024, compData, compDataSize);
+
+ // WARNING: RL_REALLOC can make (and leave) data copies in memory, be careful with sensitive compressed data!
+ // TODO: Use a different approach, create another buffer, copy data manually to it and wipe original buffer memory
unsigned char *temp = RL_REALLOC(data, length);
if (temp != NULL) data = temp;