]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
two-step: Always load the BGRT fallback image
authorHans de Goede <hdegoede@redhat.com>
Fri, 5 Mar 2021 10:57:53 +0000 (11:57 +0100)
committerHans de Goede <hdegoede@redhat.com>
Fri, 5 Mar 2021 12:52:38 +0000 (13:52 +0100)
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>
src/plugins/splash/two-step/plugin.c

index eade1ac32607ca0a4afd116729a78ecaba8c62a1..7dcd66e618a08d0bf87384e552dba6f36e0c0f06 100644 (file)
@@ -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;
                 }
         }