summaryrefslogtreecommitdiffstats
path: root/src/3rdparty
diff options
context:
space:
mode:
authorHarald Fernengel <harald@trolltech.com>2009-08-03 13:12:46 (GMT)
committerHarald Fernengel <harald@trolltech.com>2009-08-03 13:12:46 (GMT)
commit41a83e1ff19ad1396e6001e6b0ac003c701ba55a (patch)
tree609e40eda10418bbf925002c36552074796b96b6 /src/3rdparty
parentd1f3b9df2bc5c57d414da73a7d4f9ed7b25df3db (diff)
downloadQt-41a83e1ff19ad1396e6001e6b0ac003c701ba55a.zip
Qt-41a83e1ff19ad1396e6001e6b0ac003c701ba55a.tar.gz
Qt-41a83e1ff19ad1396e6001e6b0ac003c701ba55a.tar.bz2
Squashed commit of the topic/exceptions branch.
Contains some smaller fixes and renaming of macros. Looks big, but isn't scary at all ;)
Diffstat (limited to 'src/3rdparty')
-rw-r--r--src/3rdparty/freetype/src/base/ftobjs.c20
-rw-r--r--src/3rdparty/freetype/src/base/ftstream.c2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttinterp.c2
-rw-r--r--src/3rdparty/freetype/src/truetype/ttpload.c6
-rw-r--r--src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp20
-rw-r--r--src/3rdparty/phonon/phonon/abstractmediastream.h2
-rw-r--r--src/3rdparty/phonon/phonon/iodevicestream_p.h2
7 files changed, 35 insertions, 19 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/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-shaper.cpp b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
index 2e3ef38..f92bb55 100644
--- a/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
+++ b/src/3rdparty/harfbuzz/src/harfbuzz-shaper.cpp
@@ -969,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;
@@ -1004,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;
}
@@ -1124,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;
@@ -1131,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/phonon/phonon/abstractmediastream.h b/src/3rdparty/phonon/phonon/abstractmediastream.h
index c4cde85..be45861 100644
--- a/src/3rdparty/phonon/phonon/abstractmediastream.h
+++ b/src/3rdparty/phonon/phonon/abstractmediastream.h
@@ -103,7 +103,7 @@ class AbstractMediaStreamPrivate;
class PHONON_EXPORT AbstractMediaStream : public QObject
{
Q_OBJECT
- Q_DECLARE_PRIVATE(AbstractMediaStream)
+ Q_DECLARE_SCOPED_PRIVATE(AbstractMediaStream)
friend class MediaObject;
friend class MediaObjectPrivate;
friend class StreamInterface;
diff --git a/src/3rdparty/phonon/phonon/iodevicestream_p.h b/src/3rdparty/phonon/phonon/iodevicestream_p.h
index 5eb90bc..527ff17 100644
--- a/src/3rdparty/phonon/phonon/iodevicestream_p.h
+++ b/src/3rdparty/phonon/phonon/iodevicestream_p.h
@@ -39,7 +39,7 @@ class IODeviceStreamPrivate;
class IODeviceStream : public AbstractMediaStream
{
Q_OBJECT
- Q_DECLARE_PRIVATE(IODeviceStream)
+ Q_DECLARE_SCOPED_PRIVATE(IODeviceStream)
public:
explicit IODeviceStream(QIODevice *ioDevice, QObject *parent = 0);
~IODeviceStream();