| Index: chrome/browser/gtk/nine_box.cc
|
| ===================================================================
|
| --- chrome/browser/gtk/nine_box.cc (revision 20666)
|
| +++ chrome/browser/gtk/nine_box.cc (working copy)
|
| @@ -138,11 +138,21 @@
|
| if (!pixbuf)
|
| continue;
|
|
|
| + if (!gdk_pixbuf_get_has_alpha(pixbuf))
|
| + continue;
|
| +
|
| guchar* pixels = gdk_pixbuf_get_pixels(pixbuf);
|
| int rowstride = gdk_pixbuf_get_rowstride(pixbuf);
|
| + int width = gdk_pixbuf_get_width(pixbuf);
|
| + int height = gdk_pixbuf_get_height(pixbuf);
|
|
|
| - for (int i = 0; i < gdk_pixbuf_get_height(pixbuf); ++i) {
|
| - for (int j = 0; j < gdk_pixbuf_get_width(pixbuf); ++j) {
|
| + if (width * 4 > rowstride) {
|
| + NOTREACHED();
|
| + continue;
|
| + }
|
| +
|
| + for (int i = 0; i < height; ++i) {
|
| + for (int j = 0; j < width; ++j) {
|
| guchar* pixel = &pixels[i * rowstride + j * 4];
|
| if (pixel[0] == 0xff && pixel[1] == 0xff && pixel[2] == 0xff) {
|
| pixel[3] = 0;
|
|
|