]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
progress-animation: fail load if there are no frames
authorRay Strode <rstrode@redhat.com>
Wed, 23 Mar 2011 16:04:05 +0000 (12:04 -0400)
committerRay Strode <rstrode@redhat.com>
Wed, 23 Mar 2011 16:04:05 +0000 (12:04 -0400)
If there are no progress animation frames we need to
fail from the load function so plugins can deal with it
gracefully..

src/libply-splash-graphics/ply-progress-animation.c

index 079fe27d240ac0dd2de41063dbdc6e76c03b9a39..00569ecf024dafda5f6b957eb0684d210c885ab0 100644 (file)
@@ -347,6 +347,7 @@ ply_progress_animation_add_frames (ply_progress_animation_t *progress_animation)
 {
   struct dirent **entries;
   int number_of_entries;
+  int number_of_frames;
   int i;
   bool load_finished;
 
@@ -380,7 +381,18 @@ ply_progress_animation_add_frames (ply_progress_animation_t *progress_animation)
       free (entries[i]);
       entries[i] = NULL;
     }
-  load_finished = true;
+
+  number_of_frames = ply_array_get_size (progress_animation->frames);
+  if (number_of_frames == 0)
+    {
+      ply_trace ("could not find any progress animation frames");
+      load_finished = false;
+    }
+  else
+    {
+      ply_trace ("found %d progress animation frames", number_of_frames);
+      load_finished = true;
+    }
 
 out:
   if (!load_finished)