Modify LoadPixbuf() so it returns NULL when the |data| parameter is NULL.
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: de016e52bd170d2d4f2344f9bf92d50478b649e0@34535 0039d316-1c4b-4281-b951-d872f2087c98

ropik/chromium,adobe/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,yitian134/chromium,ropik/chromium,yitian134/chromium,adobe/chromium,ropik/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,adobe/chromium,gavinp/chromium,adobe/chromium,ropik/chromium,adobe/chromium,gavinp/chromium,ropik/chromium,ropik/chromium,Crystalnix/house-of-life-chromium,ropik/chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,yitian134/chromium,yitian134/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,adobe/chromium,adobe/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,yitian134/chromium,gavinp/chromium,yitian134/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,gavinp/chromium,gavinp/chromium,yitian134/chromium,yitian134/chromium,ropik/chromium,adobe/chromium,Crystalnix/house-of-life-chromium,Crystalnix/house-of-life-chromium,yitian134/chromium