mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-24 02:12:09 -05: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
|
||||
{
|
||||
QPixmap icon = QPixmap::fromImage(QImage(bitmap.scanline_u8(0), bitmap.width(), bitmap.height(), bitmap.pitch(), QImage::Format_ARGB32));
|
||||
emit m_view.favicon_changed(QIcon(icon));
|
||||
auto qimage = QImage(bitmap.scanline_u8(0), bitmap.width(), bitmap.height(), QImage::Format_ARGB32);
|
||||
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
|
||||
|
|
Loading…
Add table
Reference in a new issue