From 074aaf9901567c9c66eeca20514c78419e2016bb Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sun, 20 Jun 2010 13:08:22 +0200 Subject: Updated WebKit from /home/shausman/src/webkit/trunk to qtwebkit/qtwebkit-4.6 ( be1a105be93d7fcbe36d93d0827dc6e98b55de0c ) Changes in WebKit/qt since the last update: * https://bugs.webkit.org/show_bug.cgi?id=40567 -- [Qt] QtWebKit crashes while initializing flash plugin 10.1.53.64. --- src/3rdparty/webkit/VERSION | 2 +- src/3rdparty/webkit/WebCore/ChangeLog | 13 ++++++++++++ .../webkit/WebCore/plugins/qt/PluginPackageQt.cpp | 23 ++++++++++++++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/3rdparty/webkit/VERSION b/src/3rdparty/webkit/VERSION index 482982d..1b8e789 100644 --- a/src/3rdparty/webkit/VERSION +++ b/src/3rdparty/webkit/VERSION @@ -8,4 +8,4 @@ The commit imported was from the and has the sha1 checksum - a13977ce2aba31808a046cddc082a84dc316d78b + be1a105be93d7fcbe36d93d0827dc6e98b55de0c diff --git a/src/3rdparty/webkit/WebCore/ChangeLog b/src/3rdparty/webkit/WebCore/ChangeLog index 63af196..8a75d6b 100644 --- a/src/3rdparty/webkit/WebCore/ChangeLog +++ b/src/3rdparty/webkit/WebCore/ChangeLog @@ -1,3 +1,16 @@ +2010-06-16 Dawit Alemayehu + + Reviewed by Simon Hausmann. + + [Qt] QtWebKit crashes while initializing flash plugin 10.1.53.64. + https://bugs.webkit.org/show_bug.cgi?id=40567 + + Avoid preventable crashes by ensuring gtk_init() is called in the + flash viewer plugins before calling NP_Initialize. + + * plugins/qt/PluginPackageQt.cpp: + (WebCore::PluginPackage::load): + 2010-06-10 Raine Makelainen Reviewed by Kenneth Rohde Christiansen. diff --git a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp index 8119924..4ff520b 100644 --- a/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp +++ b/src/3rdparty/webkit/WebCore/plugins/qt/PluginPackageQt.cpp @@ -35,6 +35,8 @@ namespace WebCore { +typedef void gtkInitFunc(int *argc, char ***argv); + bool PluginPackage::fetchInfo() { if (!load()) @@ -109,6 +111,7 @@ bool PluginPackage::load() NP_InitializeFuncPtr NP_Initialize; NPError npErr; + gtkInitFunc* gtkInit; NP_Initialize = (NP_InitializeFuncPtr)m_module->resolve("NP_Initialize"); m_NPP_Shutdown = (NPP_ShutdownProcPtr)m_module->resolve("NP_Shutdown"); @@ -127,6 +130,26 @@ bool PluginPackage::load() m_browserFuncs.getvalue = staticPluginQuirkRequiresGtkToolKit_NPN_GetValue; } + // WORKAROUND: Prevent gtk based plugin crashes such as BR# 40567 by + // explicitly forcing the initializing of Gtk, i.e. calling gtk_init, + // whenver the symbol is present in the plugin library loaded above. + // Note that this workaround is based on code from the NSPluginClass ctor + // in KDE's kdebase/apps/nsplugins/viewer/nsplugin.cpp file. + gtkInit = (gtkInitFunc*)m_module->resolve("gtk_init"); + if (gtkInit) { + // Prevent gtk_init() from replacing the X error handlers, since the Gtk + // handlers abort when they receive an X error, thus killing the viewer. +#ifdef Q_WS_X11 + int (*old_error_handler)(Display*, XErrorEvent*) = XSetErrorHandler(0); + int (*old_io_error_handler)(Display*) = XSetIOErrorHandler(0); +#endif + gtkInit(0, 0); +#ifdef Q_WS_X11 + XSetErrorHandler(old_error_handler); + XSetIOErrorHandler(old_io_error_handler); +#endif + } + #if defined(XP_UNIX) npErr = NP_Initialize(&m_browserFuncs, &m_pluginFuncs); #else -- cgit v0.12 From 5c0462be41c7bad7a3e3ef08105fc1ca60d82e44 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Sun, 20 Jun 2010 22:12:43 +0200 Subject: Updated Harfbuzz from git+ssh://git.freedesktop.org/git/harfbuzz to ab9a897b688e991a8405cf938dea9d6a2f1ac072 From Andreas Kling : * Unbreak _HB_OPEN_Get_Device() and Get_ValueRecord() --- src/3rdparty/harfbuzz/src/harfbuzz-gpos.c | 25 ++++++----------------- src/3rdparty/harfbuzz/src/harfbuzz-open-private.h | 2 +- src/3rdparty/harfbuzz/src/harfbuzz-open.c | 14 +------------ 3 files changed, 8 insertions(+), 33 deletions(-) diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c index d71a85e..31b9ae1 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-gpos.c @@ -500,34 +500,24 @@ static HB_Error Get_ValueRecord( GPOS_Instance* gpi, { /* pixel -> fractional pixel */ - if ( format & HB_GPOS_FORMAT_HAVE_DEVICE_TABLES ) - { - if ( ALLOC_ARRAY( vr->DeviceTables, 4, HB_Device ) ) - return error; - vr->DeviceTables[VR_X_ADVANCE_DEVICE] = 0; - vr->DeviceTables[VR_Y_ADVANCE_DEVICE] = 0; - vr->DeviceTables[VR_X_PLACEMENT_DEVICE] = 0; - vr->DeviceTables[VR_Y_PLACEMENT_DEVICE] = 0; - } - if ( format & HB_GPOS_FORMAT_HAVE_X_PLACEMENT_DEVICE ) { - _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_PLACEMENT_DEVICE], x_ppem, &pixel_value ); gd->x_pos += pixel_value << 6; } if ( format & HB_GPOS_FORMAT_HAVE_Y_PLACEMENT_DEVICE ) { - _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_PLACEMENT_DEVICE], y_ppem, &pixel_value ); gd->y_pos += pixel_value << 6; } if ( format & HB_GPOS_FORMAT_HAVE_X_ADVANCE_DEVICE ) { - _HB_OPEN_Get_Device( &vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_X_ADVANCE_DEVICE], x_ppem, &pixel_value ); gd->x_advance += pixel_value << 6; } if ( format & HB_GPOS_FORMAT_HAVE_Y_ADVANCE_DEVICE ) { - _HB_OPEN_Get_Device( &vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value ); + _HB_OPEN_Get_Device( vr->DeviceTables[VR_Y_ADVANCE_DEVICE], y_ppem, &pixel_value ); gd->y_advance += pixel_value << 6; } } @@ -779,12 +769,9 @@ static HB_Error Get_Anchor( GPOS_Instance* gpi, case 3: if ( !gpi->dvi ) { - if ( ALLOC_ARRAY( an->af.af3.DeviceTables, 2, HB_Device ) ) - return error; - - _HB_OPEN_Get_Device( &an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value ); + _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_X_DEVICE_TABLE], x_ppem, &pixel_value ); *x_value = pixel_value << 6; - _HB_OPEN_Get_Device( &an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value ); + _HB_OPEN_Get_Device( an->af.af3.DeviceTables[AF3_Y_DEVICE_TABLE], y_ppem, &pixel_value ); *y_value = pixel_value << 6; } else diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h index 1f7b353..65ca453 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h +++ b/src/3rdparty/harfbuzz/src/harfbuzz-open-private.h @@ -93,7 +93,7 @@ _HB_OPEN_Get_Class( HB_ClassDefinition* cd, HB_UShort* klass, HB_UShort* index ); HB_INTERNAL HB_Error -_HB_OPEN_Get_Device( HB_Device** d, +_HB_OPEN_Get_Device( HB_Device* d, HB_UShort size, HB_Short* value ); diff --git a/src/3rdparty/harfbuzz/src/harfbuzz-open.c b/src/3rdparty/harfbuzz/src/harfbuzz-open.c index 255b7e6..adc6cec 100644 --- a/src/3rdparty/harfbuzz/src/harfbuzz-open.c +++ b/src/3rdparty/harfbuzz/src/harfbuzz-open.c @@ -1399,21 +1399,11 @@ _HB_OPEN_Free_Device( HB_Device** d ) mask = 0x00FF */ HB_INTERNAL HB_Error -_HB_OPEN_Get_Device( HB_Device** device, +_HB_OPEN_Get_Device( HB_Device* d, HB_UShort size, HB_Short* value ) { - HB_Device* d; HB_UShort byte, bits, mask, f, s; - HB_Error error; - - if ( ALLOC( *device, sizeof(HB_Device)) ) - { - *device = 0; - return error; - } - - d = *device; f = d->DeltaFormat; @@ -1436,8 +1426,6 @@ _HB_OPEN_Get_Device( HB_Device** device, else { *value = 0; - FREE( *device ); - *device = 0; return HB_Err_Not_Covered; } } -- cgit v0.12