fix possible crash on mediainfo parsing
authorAndreas Frisch <andreas.frisch@multimedia-labs.de>
Fri, 10 Oct 2008 11:25:40 +0000 (11:25 +0000)
committerAndreas Frisch <andreas.frisch@multimedia-labs.de>
Fri, 10 Oct 2008 11:25:40 +0000 (11:25 +0000)
lib/python/Plugins/Extensions/DVDBurn/DVDToolbox.py

index 30487b690ff1c88a1f3345d9fdde7f9c9cec0960..45a8edb607c8280c702e9cfcad2aaed1e49224e2 100644 (file)
@@ -96,8 +96,10 @@ class DVDToolbox(Screen):
                                        capacity = used
                                        used = 0
                        elif line.find("Free Blocks:") > -1:
                                        capacity = used
                                        used = 0
                        elif line.find("Free Blocks:") > -1:
-                               size = line[15:-3].split('*')
-                               size = int(size[0])*int(size[1])*1024
+                               try:
+                                       size = eval(line[14:].replace("KB","*1024"))
+                               except:
+                                       size = 0
                                if size > 0:
                                        capacity = size
                                        used = capacity-used                            
                                if size > 0:
                                        capacity = size
                                        used = capacity-used