diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-07-02 12:32:57 +0300 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-07-02 12:32:57 +0300 |
commit | 1ec0f3f9238d44eb9c60d72c3572c42c98cf2ad4 (patch) | |
tree | 308af42e07360ca60452101f7a66728754fbb755 | |
parent | e6ff84bdf56eb8213f240b2e74ec441d8ec80814 (diff) |
orc: Don't set memory protection if there's no code
If the size of the JIT code is 0, there's no code and the *mem is
uninitialized. This can happen when orcc.exe is used to generate
backup C code.
Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/44>
-rw-r--r-- | orc/orccompiler.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/orc/orccompiler.c b/orc/orccompiler.c index 23a1a84..63eee29 100644 --- a/orc/orccompiler.c +++ b/orc/orccompiler.c @@ -223,6 +223,9 @@ _set_virtual_protect (void * mem, size_t size, int code_protect) char *msg; DWORD old_protect; + /* No code, so we 'succeed' */ + if (size == 0) + return TRUE; if (!mem) return FALSE; |