summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorStephan Mühlstrasser <stm@pdflib.com>2015-10-21 09:01:31 +0200
committerStephan Mühlstrasser <stm@pdflib.com>2015-10-21 09:01:31 +0200
commitb7a162348de2f1444377e2dca9f3cbf9d770b52d (patch)
tree9e8f16c13c2d4b3d2a0572fdacbcc4be3b211ac3 /src/lib
parent540aa58f6c12224b5762f141fe71a2760e7c7766 (diff)
Avoid pointer arithmetic with (void *) pointers.
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/openjp2/opj_malloc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/openjp2/opj_malloc.c b/src/lib/openjp2/opj_malloc.c
index 04ef055c..a4aea30f 100644
--- 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 */