summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2021-03-05 11:57:53 +0100
committerHans de Goede <hdegoede@redhat.com>2021-03-05 13:52:38 +0100
commit9cb47b71cb089486cd9f6156f53f3bf1741809a0 (patch)
tree95a9348a8d7b0ca6de4f60310321669d8694f70a
parent6bd905e5e8d5e059735eb16f946b9e96b1a75422 (diff)
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 <hdegoede@redhat.com>
-rw-r--r--src/plugins/splash/two-step/plugin.c14
1 files changed, 7 insertions, 7 deletions
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;
}
}