diff options
Diffstat (limited to 'backends/networking')
-rw-r--r-- | backends/networking/curl/cloudicon.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/backends/networking/curl/cloudicon.cpp b/backends/networking/curl/cloudicon.cpp index fd587f9b5d..3ae6fd225e 100644 --- a/backends/networking/curl/cloudicon.cpp +++ b/backends/networking/curl/cloudicon.cpp @@ -122,7 +122,11 @@ void CloudIcon::loadIcon(Graphics::TransparentSurface &icon, byte *data, uint32 if (s) { Graphics::PixelFormat f = g_system->getOSDFormat(); if (f != s->format) { - Graphics::TransparentSurface *s2 = s->convertTo(f); + // Graphics::TransparentSurface::convertTo(f) errors out if the format is not 2Bpp or 4Bpp. + // We don't need to error out as we can recover from it. So check the format before calling convertTo(f); + Graphics::TransparentSurface *s2 = nullptr; + if (f.bytesPerPixel == 2 || f.bytesPerPixel == 4) + s2 = s->convertTo(f); if (s2) icon.copyFrom(*s2); else |