]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
script: fix deletion of sprites after full refresh
authorTimo Teräs <timo.teras@iki.fi>
Wed, 22 Mar 2023 11:49:47 +0000 (13:49 +0200)
committerTimo Teräs <timo.teras@iki.fi>
Wed, 22 Mar 2023 11:50:03 +0000 (13:50 +0200)
The node pointer is reused in the if (data->full_refresh) block
causing the following sprite list walking to fail. Fix this by
moving the sprite list first node getting next to the while loop
where it belongs.

src/plugins/splash/script/script-lib-sprite.c

index 1d90fef014ac4026b18da381b3224b0edc0d5a65..6397ea281a4a468f25e8ddf541473c5f40775425 100644 (file)
@@ -757,9 +757,6 @@ script_lib_sprite_refresh (script_lib_sprite_data_t *data)
 
         ply_list_sort_stable (data->sprite_list, &sprite_compare_z);
 
-        node = ply_list_get_first_node (data->sprite_list);
-
-
         if (data->full_refresh) {
                 for (node = ply_list_get_first_node (data->displays);
                      node;
@@ -775,6 +772,7 @@ script_lib_sprite_refresh (script_lib_sprite_data_t *data)
                 data->full_refresh = false;
         }
 
+        node = ply_list_get_first_node (data->sprite_list);
         while (node) {
                 sprite_t *sprite = ply_list_node_get_data (node);
                 ply_list_node_t *next_node = ply_list_get_next_node (data->sprite_list,