diff options
Diffstat (limited to 'src/3rdparty')
20 files changed, 105 insertions, 28 deletions
diff --git a/src/3rdparty/freetype/src/base/ftobjs.c b/src/3rdparty/freetype/src/base/ftobjs.c index 8208e2a..f90af67 100644 --- a/src/3rdparty/freetype/src/base/ftobjs.c +++ b/src/3rdparty/freetype/src/base/ftobjs.c @@ -244,7 +244,7 @@ FT_BASE_DEF( void ) ft_glyphslot_free_bitmap( FT_GlyphSlot slot ) { - if ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) + if ( slot->internal && slot->internal->flags & FT_GLYPH_OWN_BITMAP ) { FT_Memory memory = FT_FACE_MEMORY( slot->face ); @@ -337,14 +337,18 @@ /* free bitmap buffer if needed */ ft_glyphslot_free_bitmap( slot ); - /* free glyph loader */ - if ( FT_DRIVER_USES_OUTLINES( driver ) ) + /* slot->internal might be 0 in out-of-memory situations */ + if ( slot->internal ) { - FT_GlyphLoader_Done( slot->internal->loader ); - slot->internal->loader = 0; - } + /* free glyph loader */ + if ( FT_DRIVER_USES_OUTLINES( driver ) ) + { + FT_GlyphLoader_Done( slot->internal->loader ); + slot->internal->loader = 0; + } - FT_FREE( slot->internal ); + FT_FREE( slot->internal ); + } } @@ -1096,7 +1100,7 @@ if ( error ) { destroy_charmaps( face, memory ); - if ( clazz->done_face ) + if ( clazz->done_face && face ) clazz->done_face( face ); FT_FREE( internal ); FT_FREE( face ); diff --git a/src/3rdparty/freetype/src/base/ftstream.c b/src/3rdparty/freetype/src/base/ftstream.c index 569e46c..2082345 100644 --- a/src/3rdparty/freetype/src/base/ftstream.c +++ b/src/3rdparty/freetype/src/base/ftstream.c @@ -211,7 +211,7 @@ FT_Stream_ReleaseFrame( FT_Stream stream, FT_Byte** pbytes ) { - if ( stream->read ) + if ( stream && stream->read ) { FT_Memory memory = stream->memory; diff --git a/src/3rdparty/freetype/src/gzip/zconf.h b/src/3rdparty/freetype/src/gzip/zconf.h index 3ccc3a6..2030a7e 100644 --- a/src/3rdparty/freetype/src/gzip/zconf.h +++ b/src/3rdparty/freetype/src/gzip/zconf.h @@ -5,6 +5,11 @@ /* @(#) $Id: zconf.h,v 1.4 2007/06/01 06:56:17 wl Exp $ */ +#if defined(__ARMCC__) || defined(__CC_ARM) +/* Ultra ugly hack that convinces RVCT to use the systems zlib */ +#include <stdapis/zconf.h> +#else /* defined(__ARMCC__) || defined(__CC_ARM) */ + #ifndef _ZCONF_H #define _ZCONF_H @@ -276,3 +281,5 @@ typedef uLong FAR uLongf; #endif #endif /* _ZCONF_H */ + +#endif /* defined(__ARMCC__) || defined(__CC_ARM) */ diff --git a/src/3rdparty/freetype/src/gzip/zlib.h b/src/3rdparty/freetype/src/gzip/zlib.h index 50d0d3f..0f98fdc 100644 --- a/src/3rdparty/freetype/src/gzip/zlib.h +++ b/src/3rdparty/freetype/src/gzip/zlib.h @@ -28,6 +28,11 @@ (zlib format), rfc1951.txt (deflate format) and rfc1952.txt (gzip format). */ +#if defined(__ARMCC__) || defined(__CC_ARM) +/* Ultra ugly hack that convinces RVCT to use the systems zlib */ +#include <stdapis/zlib.h> +#else /* defined(__ARMCC__) || defined(__CC_ARM) */ + #ifndef _ZLIB_H #define _ZLIB_H @@ -828,3 +833,5 @@ ZEXTERN(int) inflateInit2_ OF((z_streamp strm, int windowBits, #endif #endif /* _ZLIB_H */ + +#endif /* defined(__ARMCC__) || defined(__CC_ARM) */ diff --git a/src/3rdparty/freetype/src/truetype/ttinterp.c b/src/3rdparty/freetype/src/truetype/ttinterp.c index f9c3656..143ca65 100644 --- a/src/3rdparty/freetype/src/truetype/ttinterp.c +++ b/src/3rdparty/freetype/src/truetype/ttinterp.c @@ -799,8 +799,6 @@ return driver->context; Fail: - FT_FREE( exec ); - return 0; } diff --git a/src/3rdparty/freetype/src/truetype/ttpload.c b/src/3rdparty/freetype/src/truetype/ttpload.c index 9d3381b..38674a1 100644 --- a/src/3rdparty/freetype/src/truetype/ttpload.c +++ b/src/3rdparty/freetype/src/truetype/ttpload.c @@ -483,10 +483,10 @@ tt_face_free_hdmx( TT_Face face ) { FT_Stream stream = face->root.stream; - FT_Memory memory = stream->memory; - + FT_Memory memory = stream ? stream->memory : NULL; - FT_FREE( face->hdmx_record_sizes ); + if ( face->hdmx_record_sizes ) + FT_FREE( face->hdmx_record_sizes ); FT_FRAME_RELEASE( face->hdmx_table ); } diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-global.h b/src/3rdparty/harfbuzz/src/harfbuzz-global.h index d4e6b46..393cc7b 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-global.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-global.h @@ -28,7 +28,13 @@ #ifndef HARFBUZZ_GLOBAL_H #define HARFBUZZ_GLOBAL_H +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#else #include <stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus + #include <string.h> #ifdef __cplusplus diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-impl.c b/src/3rdparty/harfbuzz/src/harfbuzz-impl.c index 9056a55..ddbf36b 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-impl.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-impl.c @@ -33,7 +33,7 @@ HB_INTERNAL HB_Pointer _hb_alloc(size_t size, HB_Error *perror ) { - HB_Error error = 0; + HB_Error error = (HB_Error)0; HB_Pointer block = NULL; if ( size > 0 ) @@ -54,7 +54,7 @@ _hb_realloc(HB_Pointer block, HB_Error *perror ) { HB_Pointer block2 = NULL; - HB_Error error = 0; + HB_Error error = (HB_Error)0; block2 = realloc( block, new_size ); if ( block2 == NULL && new_size != 0 ) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp index 36b9282..f92bb55 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp +++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp @@ -935,7 +935,13 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta if (error) return 0; stream = (HB_Stream)malloc(sizeof(HB_StreamRec)); + if (!stream) + return 0; stream->base = (HB_Byte*)malloc(length); + if (!stream->base) { + free(stream); + return 0; + } error = tableFunc(font, tag, stream->base, &length); if (error) { _hb_close_stream(stream); @@ -950,6 +956,8 @@ static HB_Stream getTableStream(void *font, HB_GetFontTableFunc tableFunc, HB_Ta HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) { HB_Face face = (HB_Face )malloc(sizeof(HB_FaceRec)); + if (!face) + return 0; face->isSymbolFont = false; face->gdef = 0; @@ -961,6 +969,7 @@ HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) face->tmpAttributes = 0; face->tmpLogClusters = 0; face->glyphs_substituted = false; + face->buffer = 0; HB_Error error; HB_Stream stream; @@ -996,7 +1005,10 @@ HB_Face HB_NewFace(void *font, HB_GetFontTableFunc tableFunc) for (unsigned int i = 0; i < HB_ScriptCount; ++i) face->supported_scripts[i] = checkScript(face, i); - hb_buffer_new(&face->buffer); + if (hb_buffer_new(&face->buffer) != HB_Err_Ok) { + HB_FreeFace(face); + return 0; + } return face; } @@ -1116,6 +1128,8 @@ HB_Bool HB_SelectScript(HB_ShaperItem *shaper_item, const HB_OpenTypeFeature *fe HB_Bool HB_OpenTypeShape(HB_ShaperItem *item, const hb_uint32 *properties) { + HB_GlyphAttributes *tmpAttributes; + unsigned int *tmpLogClusters; HB_Face face = item->face; @@ -1123,8 +1137,16 @@ HB_Bool HB_OpenTypeShape(HB_ShaperItem *item, const hb_uint32 *properties) hb_buffer_clear(face->buffer); - face->tmpAttributes = (HB_GlyphAttributes *) realloc(face->tmpAttributes, face->length*sizeof(HB_GlyphAttributes)); - face->tmpLogClusters = (unsigned int *) realloc(face->tmpLogClusters, face->length*sizeof(unsigned int)); + tmpAttributes = (HB_GlyphAttributes *) realloc(face->tmpAttributes, face->length*sizeof(HB_GlyphAttributes)); + if (!tmpAttributes) + return false; + face->tmpAttributes = tmpAttributes; + + tmpLogClusters = (unsigned int *) realloc(face->tmpLogClusters, face->length*sizeof(unsigned int)); + if (!tmpLogClusters) + return false; + face->tmpLogClusters = tmpLogClusters; + for (int i = 0; i < face->length; ++i) { hb_buffer_add_glyph(face->buffer, item->glyphs[i], properties ? properties[i] : 0, i); face->tmpAttributes[i] = item->attributes[i]; diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-stream.c b/src/3rdparty/harfbuzz/src/harfbuzz-stream.c index 3dcee82..2d9638f 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-stream.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-stream.c @@ -70,7 +70,7 @@ HB_INTERNAL HB_Error _hb_stream_seek( HB_Stream stream, HB_UInt pos ) { - HB_Error error = 0; + HB_Error error = (HB_Error)0; stream->pos = pos; if (pos > stream->size) diff --git a/src/3rdparty/libjpeg/jinclude.h b/src/3rdparty/libjpeg/jinclude.h index 0a4f151..725bd51 100644 --- a/src/3rdparty/libjpeg/jinclude.h +++ b/src/3rdparty/libjpeg/jinclude.h @@ -36,7 +36,12 @@ #endif #ifdef HAVE_STDLIB_H +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#else #include <stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus #endif #ifdef NEED_SYS_TYPES_H diff --git a/src/3rdparty/libmng/libmng_types.h b/src/3rdparty/libmng/libmng_types.h index 81fb29f..45be543 100644 --- a/src/3rdparty/libmng/libmng_types.h +++ b/src/3rdparty/libmng/libmng_types.h @@ -198,7 +198,12 @@ #endif /* MNG_INCLUDE_IJG6B */ #if defined(MNG_INTERNAL_MEMMNGMT) || defined(MNG_INCLUDE_FILTERS) -#include <stdlib.h> /* "calloc" & "free" & "abs" */ +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#else +#include <stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus #endif #include <limits.h> /* get proper integer widths */ diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h index 8eb7d35..e680a05 100644 --- a/src/3rdparty/libpng/pngconf.h +++ b/src/3rdparty/libpng/pngconf.h @@ -353,7 +353,12 @@ /* Other defines for things like memory and the like can go here. */ #ifdef PNG_INTERNAL +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#else #include <stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus /* The functions exported by PNG_EXTERN are PNG_INTERNAL functions, which * aren't usually used outside the library (as far as I know), so it is @@ -1333,7 +1338,9 @@ typedef z_stream FAR * png_zstreamp; defined(WIN32) || defined(_WIN32) || defined(__WIN32__) )) # ifndef PNGAPI -# if defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) +# if (defined(__GNUC__) && defined(__arm__)) || defined (__ARMCC__) +# define PNGAPI +# elif defined(__GNUC__) || (defined (_MSC_VER) && (_MSC_VER >= 800)) || defined(__WINSCW__) # define PNGAPI __cdecl # else # define PNGAPI _cdecl diff --git a/src/3rdparty/libtiff/libtiff/tif_config.h b/src/3rdparty/libtiff/libtiff/tif_config.h index 689421c..a6bb35d 100644 --- a/src/3rdparty/libtiff/libtiff/tif_config.h +++ b/src/3rdparty/libtiff/libtiff/tif_config.h @@ -104,7 +104,7 @@ /* #undef HAVE_PTHREAD */ /* Define to 1 if you have the <search.h> header file. */ -#if !defined(Q_OS_WINCE) && !defined(Q_OS_VXWORKS) +#if !defined(Q_OS_WINCE) && !defined(Q_OS_SYMBIAN) && !defined(Q_OS_VXWORKS) #define HAVE_SEARCH_H 1 #endif @@ -284,10 +284,12 @@ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef Q_OS_SYMBIAN #ifndef __cplusplus #undef inline #define inline #endif +#endif /* Define to `long' if <sys/types.h> does not define. */ /* #undef off_t */ diff --git a/src/3rdparty/libtiff/libtiff/tif_unix.c b/src/3rdparty/libtiff/libtiff/tif_unix.c index 28de5c9..b60a0e1 100644 --- a/src/3rdparty/libtiff/libtiff/tif_unix.c +++ b/src/3rdparty/libtiff/libtiff/tif_unix.c @@ -35,7 +35,12 @@ #endif #include <stdarg.h> +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#else #include <stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus #include <sys/stat.h> #ifdef HAVE_UNISTD_H @@ -181,7 +186,7 @@ TIFFOpen(const char* name, const char* mode) return tif; } -#ifdef __WIN32__ +#if defined (__WIN32__) && !defined(__SYMBIAN32__) #include <windows.h> /* * Open a TIFF file with a Unicode filename, for read/writing. diff --git a/src/3rdparty/libtiff/libtiff/tiffio.h b/src/3rdparty/libtiff/libtiff/tiffio.h index 7aaf561..96223d7 100644 --- a/src/3rdparty/libtiff/libtiff/tiffio.h +++ b/src/3rdparty/libtiff/libtiff/tiffio.h @@ -71,6 +71,11 @@ typedef uint32 toff_t; /* file offset */ #define __WIN32__ #endif +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus + /* * On windows you should define USE_WIN32_FILEIO if you are using tif_win32.c * or AVOID_WIN32_FILEIO if you are using something else (like tif_unix.c). diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.cpp b/src/3rdparty/phonon/phonon/abstractmediastream.cpp index a661702..5b860f3 100644 --- a/src/3rdparty/phonon/phonon/abstractmediastream.cpp +++ b/src/3rdparty/phonon/phonon/abstractmediastream.cpp @@ -49,7 +49,6 @@ AbstractMediaStream::AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject AbstractMediaStream::~AbstractMediaStream() { - delete d_ptr; } qint64 AbstractMediaStream::streamSize() const diff --git a/src/3rdparty/phonon/phonon/abstractmediastream.h b/src/3rdparty/phonon/phonon/abstractmediastream.h index 0daa92a..c4cde85 100644 --- a/src/3rdparty/phonon/phonon/abstractmediastream.h +++ b/src/3rdparty/phonon/phonon/abstractmediastream.h @@ -214,7 +214,7 @@ class PHONON_EXPORT AbstractMediaStream : public QObject virtual void seekStream(qint64 offset); AbstractMediaStream(AbstractMediaStreamPrivate &dd, QObject *parent); - AbstractMediaStreamPrivate *d_ptr; + QScopedPointer<AbstractMediaStreamPrivate> d_ptr; }; } // namespace Phonon diff --git a/src/3rdparty/phonon/phonon/abstractmediastream_p.h b/src/3rdparty/phonon/phonon/abstractmediastream_p.h index a9d6489..0e87c4d 100644 --- a/src/3rdparty/phonon/phonon/abstractmediastream_p.h +++ b/src/3rdparty/phonon/phonon/abstractmediastream_p.h @@ -45,6 +45,7 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan public: void setStreamInterface(StreamInterface *); void setMediaObjectPrivate(MediaObjectPrivate *); + ~AbstractMediaStreamPrivate(); protected: AbstractMediaStreamPrivate() @@ -56,7 +57,6 @@ class PHONON_EXPORT AbstractMediaStreamPrivate : private MediaNodeDestructionHan errorType(NoError) { } - ~AbstractMediaStreamPrivate(); virtual void setStreamSize(qint64 newSize); virtual void setStreamSeekable(bool s); diff --git a/src/3rdparty/zlib/zutil.h b/src/3rdparty/zlib/zutil.h index b7d5eff..3ecb1bb 100644 --- a/src/3rdparty/zlib/zutil.h +++ b/src/3rdparty/zlib/zutil.h @@ -21,7 +21,12 @@ # include <stddef.h> # endif # include <string.h> -# include <stdlib.h> +// Bug in stdlib.h, see more information from fixed_stdlib.h +#if (defined __SYMBIAN32__ && !defined __cplusplus) +#include <fixed_stdlib.h> +#else +#include <stdlib.h> +#endif // defined __SYMBIAN32__ && !defined __cplusplus #endif #ifdef NO_ERRNO_H # ifdef _WIN32_WCE |