← Back to team overview

openshot.code team mailing list archive

[Branch ~openshot.code/openshot/main] Rev 653: Added an extra check to the thumbnailer to test for corrupt files, i.e. those that have zero leng...

 

------------------------------------------------------------
revno: 653
fixes bug: https://launchpad.net/bugs/927755
committer: Andy Finch <we.rocked.in79@xxxxxxxxx>
branch nick: openshot
timestamp: Mon 2012-04-16 20:44:17 +0100
message:
  Added an extra check to the thumbnailer to test for corrupt files, i.e. those that have zero length as returned by p.get_length().
modified:
  openshot/classes/thumbnail.py


--
lp:openshot
https://code.launchpad.net/~openshot.code/openshot/main

Your team OpenShot Code is subscribed to branch lp:openshot.
To unsubscribe from this branch go to https://code.launchpad.net/~openshot.code/openshot/main/+edit-subscription
=== modified file 'openshot/classes/thumbnail.py'
--- openshot/classes/thumbnail.py	2012-04-10 21:52:25 +0000
+++ openshot/classes/thumbnail.py	2012-04-16 19:44:17 +0000
@@ -88,6 +88,12 @@
 			if self.p.is_valid() == False:
 				return None
 			
+			# Check for invalid files - badly generated video files can have
+			# a length of 0 or -1, e.g. 
+			# https://bugs.launchpad.net/ubuntu/+source/openshot/+bug/927755, https://bugs.launchpad.net/kazam/+bug/925238
+			if self.p.get_length() < 1 or self.p.get_length() == 0x7fffffff:
+				return None
+			
 			# check the 'seekable' property
 			# If it is zero, then MLT is likely to have problems with this file.
 			if self.p.get("seekable") == '0':