From: Hans de Goede Date: Fri, 5 Mar 2021 10:57:53 +0000 (+0100) Subject: two-step: Always load the BGRT fallback image X-Git-Tag: 22.02.122~23^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9cb47b71cb089486cd9f6156f53f3bf1741809a0;p=thirdparty%2Fplymouth.git two-step: Always load the BGRT fallback image view_set_bgrt_background() can fail even if the BGRT image was loaded successfully. So we may need the fallback image even though the BGRT image was loaded successfully. This commit also fixes plugin->background_bgrt_fallback_image not being free-ed and set to NULL when loading the fallback image fails. Note this also drops the clearing of the use_firmware_background flagss when we fail to load both the BGRT and the fallback images. Clearing these flags is not necessary. They are only checked if plugin->background_bgrt_image or plugin->background_bgrt_fallback_image are non NULL; and if the loading of both images failed then both are NULL. Signed-off-by: Hans de Goede --- diff --git a/src/plugins/splash/two-step/plugin.c b/src/plugins/splash/two-step/plugin.c index eade1ac3..7dcd66e6 100644 --- a/src/plugins/splash/two-step/plugin.c +++ b/src/plugins/splash/two-step/plugin.c @@ -1693,16 +1693,16 @@ show_splash_screen (ply_boot_splash_plugin_t *plugin, plugin->background_bgrt_raw_width = ply_image_get_width (plugin->background_bgrt_image); plugin->background_bgrt_raw_height = ply_image_get_height (plugin->background_bgrt_image); } else { - ply_trace ("loading background bgrt fallback image"); - ply_image_free (plugin->background_bgrt_image); plugin->background_bgrt_image = NULL; + } + } - if (!ply_image_load (plugin->background_bgrt_fallback_image)) { - for (i = 0; i < PLY_BOOT_SPLASH_MODE_COUNT; i++) - plugin->mode_settings[i].use_firmware_background = false; - plugin->use_firmware_background = false; - } + if (plugin->background_bgrt_fallback_image != NULL) { + ply_trace ("loading background bgrt fallback image"); + if (!ply_image_load (plugin->background_bgrt_fallback_image)) { + ply_image_free (plugin->background_bgrt_fallback_image); + plugin->background_bgrt_fallback_image = NULL; } }