Ladybird: Check for errors while decoding favicons
This commit is contained in:
parent
50b3672f52
commit
a08e83e2cc
Notes:
sideshowbarker
2024-07-17 05:05:51 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a08e83e2cc Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg
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