debug-viewer: solved crash when maximum freq sentinel is 0
authorXabier Rodriguez Calvar <calvaris@igalia.com>
Tue, 13 Mar 2018 12:48:00 +0000 (13:48 +0100)
committerThibault Saunier <tsaunier@igalia.com>
Tue, 13 Mar 2018 13:21:36 +0000 (10:21 -0300)
https://bugzilla.gnome.org/show_bug.cgi?id=794282

debug-viewer/GstDebugViewer/Plugins/Timeline.py

index 91881ff..2ad3599 100644 (file)
@@ -725,7 +725,11 @@ class TimelineWidget (Gtk.DrawingArea):
         if not data:
             return
 
-        heights = [height * float(d) / maximum for d in data]
+        if maximum:
+            heights = [height * float(d) / maximum for d in data]
+        else:
+            heights = [0. for d in data]
+
         ctx.move_to(0, height)
         for i in range(len(heights)):
             ctx.line_to(i - .5, height - heights[i] + .5)