mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:37:35 +00:00
Ladybird: Check for errors while decoding favicons
This commit is contained in:
parent
50b3672f52
commit
a08e83e2cc
1 changed files with 7 additions and 2 deletions
|
@ -220,8 +220,13 @@ public:
|
||||||
|
|
||||||
virtual void page_did_change_favicon(Gfx::Bitmap const& bitmap) override
|
virtual void page_did_change_favicon(Gfx::Bitmap const& bitmap) override
|
||||||
{
|
{
|
||||||
QPixmap icon = QPixmap::fromImage(QImage(bitmap.scanline_u8(0), bitmap.width(), bitmap.height(), bitmap.pitch(), QImage::Format_ARGB32));
|
auto qimage = QImage(bitmap.scanline_u8(0), bitmap.width(), bitmap.height(), QImage::Format_ARGB32);
|
||||||
emit m_view.favicon_changed(QIcon(icon));
|
if (qimage.isNull())
|
||||||
|
return;
|
||||||
|
auto qpixmap = QPixmap::fromImage(qimage);
|
||||||
|
if (qpixmap.isNull())
|
||||||
|
return;
|
||||||
|
emit m_view.favicon_changed(QIcon(qpixmap));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void page_did_layout() override
|
virtual void page_did_layout() override
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue