[shotwell] Prevent video thumbnailer from hanging on malformed vids: Bug #741821



commit 6a35d61c74aeb08cfd025af078224408b11504c8
Author: Jim Nelson <jim yorba org>
Date:   Mon Dec 22 13:21:13 2014 -0800

    Prevent video thumbnailer from hanging on malformed vids: Bug #741821
    
    Bogus 100-byte file was causing video thumbnailer to hang during pre-
    roll.  Failure to retrieve duration of video is a good clue that the
    video itself is not valid for thumbnailing.

 thumbnailer/shotwell-video-thumbnailer.vala |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/thumbnailer/shotwell-video-thumbnailer.vala b/thumbnailer/shotwell-video-thumbnailer.vala
index 1202182..e780141 100644
--- a/thumbnailer/shotwell-video-thumbnailer.vala
+++ b/thumbnailer/shotwell-video-thumbnailer.vala
@@ -59,7 +59,10 @@ class ShotwellThumbnailer {
             }
 
             /* get the duration */
-            pipeline.query_duration (Gst.Format.TIME, out duration);
+            if (!pipeline.query_duration (Gst.Format.TIME, out duration)) {
+                stderr.printf("Failed to query file for duration\n");
+                return 3;
+            }
 
             position = 1 * Gst.SECOND;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]