projects
/
openjpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
540aa58
)
Avoid pointer arithmetic with (void *) pointers.
644/head
author
Stephan Mühlstrasser
<stm@pdflib.com>
Wed, 21 Oct 2015 07:01:31 +0000
(09:01 +0200)
committer
Stephan Mühlstrasser
<stm@pdflib.com>
Wed, 21 Oct 2015 07:01:31 +0000
(09:01 +0200)
src/lib/openjp2/opj_malloc.c
patch
|
blob
|
history
diff --git
a/src/lib/openjp2/opj_malloc.c
b/src/lib/openjp2/opj_malloc.c
index 04ef055c9434aae571ca9c16eee4c91295fac016..a4aea30f252a759a52030210c3e311965f4a3598 100644
(file)
--- a/
src/lib/openjp2/opj_malloc.c
+++ b/
src/lib/openjp2/opj_malloc.c
@@
-166,7
+166,7
@@
static INLINE void *opj_aligned_realloc_n(void *ptr, size_t alignment, size_t ne
size_t new_offset;
/* realloc created a new copy, realign the copied memory block */
- old_offset = (size_t)(
ptr -
oldmem);
+ old_offset = (size_t)(
(OPJ_UINT8*)ptr - (OPJ_UINT8*)
oldmem);
/* offset = ((alignment + 1U) - ((size_t)(mem + sizeof(void*)) & alignment)) & alignment; */
/* Use the fact that alignment + 1U is a power of 2 */