summaryrefslogtreecommitdiffstats
path: root/src/libuemf
diff options
context:
space:
mode:
authorMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
committerMichael Soegtrop <MSoegtrop@yahoo.de>2017-06-05 13:01:17 +0000
commite7248b2fa042f42a5c4dd14cd86ab6a5b4524059 (patch)
tree9097520c54e355ded9bd0b4d6618af4e8dacdd91 /src/libuemf
parentupdated to latest trunk (diff)
parent[Bug #1695016] Xaml export misses some radialGradients. (diff)
downloadinkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.tar.gz
inkscape-e7248b2fa042f42a5c4dd14cd86ab6a5b4524059.zip
updated to latest trunk
(bzr r14876.2.4)
Diffstat (limited to 'src/libuemf')
-rw-r--r--src/libuemf/Makefile_insert30
-rw-r--r--src/libuemf/uemf.h24
-rw-r--r--src/libuemf/uwmf.c3
-rw-r--r--src/libuemf/uwmf.h2
4 files changed, 21 insertions, 38 deletions
diff --git a/src/libuemf/Makefile_insert b/src/libuemf/Makefile_insert
deleted file mode 100644
index 427a0e80e..000000000
--- a/src/libuemf/Makefile_insert
+++ /dev/null
@@ -1,30 +0,0 @@
-## Makefile.am fragment sourced by src/Makefile.am.
-
-libuemf/all: libuemf.a
-
-libuemf/clean:
- rm -f libuemf/libuemf.a $(libuemf_libuemf_a_OBJECTS)
-
-libuemf_libuemf_a_SOURCES = \
- libuemf/uemf.c \
- libuemf/uemf.h \
- libuemf/uemf_endian.c \
- libuemf/uemf_endian.h \
- libuemf/uemf_print.c \
- libuemf/uemf_print.h \
- libuemf/uemf_safe.c \
- libuemf/uemf_safe.h \
- libuemf/uemf_utf.c \
- libuemf/uemf_utf.h \
- libuemf/uwmf.c \
- libuemf/uwmf.h \
- libuemf/uwmf_endian.c \
- libuemf/uwmf_endian.h \
- libuemf/uwmf_print.c \
- libuemf/uwmf_print.h \
- libuemf/upmf.c \
- libuemf/upmf.h \
- libuemf/upmf_print.c \
- libuemf/upmf_print.h \
- libuemf/symbol_convert.c \
- libuemf/symbol_convert.h
diff --git a/src/libuemf/uemf.h b/src/libuemf/uemf.h
index 82fd0990c..05566af06 100644
--- a/src/libuemf/uemf.h
+++ b/src/libuemf/uemf.h
@@ -168,12 +168,24 @@ extern "C" {
#define U_ROUND(A) ( (A) > 0 ? floor((A)+0.5) : ( (A) < 0 ? -floor(-(A)+0.5) : (A) ) )
#define MAKE_MIN_PTR(A,B) ( A < B ? A : B)
-/* This is tricky. The next one can be called with a size which is either an int or an unsigned int.
- The former can be negative, which is obviously wrong, but testing for that means that the size cannot
- be more than INT_MAX/2. Accept that limitation since no reasonable EMF record or file should ever be that large.
- B must be an INT or size_t.
- If a uint16_t is used gcc complains about the first test. Force B to be at least as big as int (at run time) */
-#define IS_MEM_UNSAFE(A,B,C) ( (sizeof(B) < sizeof(int) || (int)(B)) < 0 ? 1 : ((int8_t *)(A) > (int8_t *)(C) ? 1 : ((int8_t *)(C) - (int8_t *)(A) >= (int)(B) ? 0 : 1 ))) //!< Return 1 when a region of memory starting at A of B bytes extends beyond pointer C
+
+/* IS_MEM_UNSAFE takes 3 parameters:
+ A start address of a block of allocated memory
+ B offset into this block starting at A
+ C address of final byte of a block of allocated memory.
+ Returns
+ 1 if B cannot be an int or size_t
+ 1 if C > A
+ 1 if A+B is not in the range A to C, inclusive
+ 0 otherwise.
+ B may be an int, an unsigned int, or a size_t. An int can be negative,
+ which is obviously wrong, but testing for that means that the size
+ of B cannot be more than INT_MAX/2. Accept that limitation since
+ no reasonable EMF record or file should ever be that large.
+ If B is a uint16_t gcc complains about the first test.
+ This Macro must not be used where B needs more than 32 bits!
+*/
+#define IS_MEM_UNSAFE(A,B,C) ( (sizeof(B) < sizeof(int) || (int)(B) < 0) ? 1 : ((int8_t *)(A) > (int8_t *)(C) ? 1 : ((int8_t *)(C) - (int8_t *)(A) >= (int)(B) ? 0 : 1 )))
/** @} */
diff --git a/src/libuemf/uwmf.c b/src/libuemf/uwmf.c
index 62e3d3c06..50e4075d8 100644
--- a/src/libuemf/uwmf.c
+++ b/src/libuemf/uwmf.c
@@ -1517,8 +1517,9 @@ int wmf_start(
\brief Release memory for an wmf structure in memory. Call this after wmf_finish().
\return 0 on success, >=1 on failure
\param wt WMF in memory
+ Renamed to uwmf_free to avoid conflict with libwmf
*/
-int wmf_free(
+int uwmf_free(
WMFTRACK **wt
){
WMFTRACK *wtl;
diff --git a/src/libuemf/uwmf.h b/src/libuemf/uwmf.h
index 138ffab37..529232ca9 100644
--- a/src/libuemf/uwmf.h
+++ b/src/libuemf/uwmf.h
@@ -2078,7 +2078,7 @@ typedef struct {
// Prototypes (_set first, then _get)
char *wmr_dup(const char *wmr);
int wmf_start(const char *name, uint32_t initsize, uint32_t chunksize, WMFTRACK **wt);
-int wmf_free(WMFTRACK **wt);
+int uwmf_free(WMFTRACK **wt);
int wmf_finish(WMFTRACK *wt);
int wmf_append(U_METARECORD *rec, WMFTRACK *wt, int freerec);
int wmf_header_append(U_METARECORD *rec,WMFTRACK *et, int freerec);