diff options
author | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 08:02:09 +0000 |
---|---|---|
committer | yusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-15 08:02:09 +0000 |
commit | 5e6fef06b01974607105482ed637727e7686bab5 (patch) | |
tree | 1de585431dfb5c597e77226f6f502dfac2a78692 /app | |
parent | fe819f59af82e406856b7361678de53121eecf91 (diff) | |
download | chromium_src-5e6fef06b01974607105482ed637727e7686bab5.zip chromium_src-5e6fef06b01974607105482ed637727e7686bab5.tar.gz chromium_src-5e6fef06b01974607105482ed637727e7686bab5.tar.bz2 |
Modify LoadPixbuf() so it returns NULL when the |data| parameter is NULL.
On the latest Chromium build for Chrome OS, r32471, I experienced the following crash during startup possibly due to resource collapse.
Since it's not easy to reproduce, I'm still not sure why the resource was collapsed, but anyway this tiny patch prevents SIGSEGV even when image resources are missing for some reason.
$ gdb ./out/Debug/chrome
...
(gdb) r
...
[16434:16434:50993697347:ERROR:base/data_pack.cc(108)] No resource found with id: 25540
Program received signal SIGSEGV, Segmentation fault.
0x0879d315 in LoadPixbuf (data=0x0, rtl_enabled=true) at app/resource_bundle_linux.cc:31
31 reinterpret_cast<const guint8*>(data->front()), data->size(), NULL);
(gdb) bt
#0 0x0879d315 in LoadPixbuf (data=0x0, rtl_enabled=true) at app/resource_bundle_linux.cc:31
#1 0x0879e0e0 in ResourceBundle::GetPixbufImpl (this=0xb6bf680, resource_id=25540, rtl_enabled=true) at app/resource_bundle_linux.cc:166
#2 0x0879e394 in ResourceBundle::GetRTLEnabledPixbufNamed (this=0xb6bf680, resource_id=25540) at app/resource_bundle_linux.cc:208
#3 0x0814fb78 in CustomDrawButtonBase (this=0xb748ee8, theme_provider=0x0, normal_id=25540, active_id=25540, highlight_id=25540, depressed_id=0, background_id=0) at chrome/browser/gtk/custom_button.cc:47
#4 0x0815050a in CustomDrawButton (this=0xb748ee0, normal_id=25540, active_id=25540, highlight_id=25540, depressed_id=0) at chrome/browser/gtk/custom_button.cc:150
#5 0x08146f6a in BrowserWindowGtk::InitWidgets (this=0xb49062d0) at chrome/browser/gtk/browser_window_gtk.cc:1681
#6 0x081434a5 in BrowserWindowGtk (this=0xb49062d0, browser=0xb4904238) at chrome/browser/gtk/browser_window_gtk.cc:578
#7 0x08439d8a in BrowserWindow::CreateBrowserWindow (browser=0xb4904238) at chrome/browser/gtk/browser_window_factory_gtk.cc:12
#8 0x08382aec in Browser::CreateBrowserWindow (this=0xb4904238) at chrome/browser/browser.cc:230
#9 0x08382938 in Browser::Create (profile=0xb6c5bd8) at chrome/browser/browser.cc:204
...
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/399110
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34535 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'app')
-rw-r--r-- | app/resource_bundle_linux.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/resource_bundle_linux.cc b/app/resource_bundle_linux.cc index 95d5ceb..fb78e02 100644 --- a/app/resource_bundle_linux.cc +++ b/app/resource_bundle_linux.cc @@ -27,7 +27,7 @@ namespace { // memory. GdkPixbuf* LoadPixbuf(RefCountedStaticMemory* data, bool rtl_enabled) { ScopedGObject<GdkPixbufLoader>::Type loader(gdk_pixbuf_loader_new()); - bool ok = gdk_pixbuf_loader_write(loader.get(), + bool ok = data && gdk_pixbuf_loader_write(loader.get(), reinterpret_cast<const guint8*>(data->front()), data->size(), NULL); if (!ok) return NULL; |