From: Xabier Rodriguez Calvar Date: Tue, 13 Mar 2018 12:48:00 +0000 (+0100) Subject: debug-viewer: solved crash when maximum freq sentinel is 0 X-Git-Tag: 1.19.3~491^2~569 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8db603f8c845f194ecdaedf51a7aa2de739e40c4;p=platform%2Fupstream%2Fgstreamer.git debug-viewer: solved crash when maximum freq sentinel is 0 https://bugzilla.gnome.org/show_bug.cgi?id=794282 --- diff --git a/debug-viewer/GstDebugViewer/Plugins/Timeline.py b/debug-viewer/GstDebugViewer/Plugins/Timeline.py index 91881ff..2ad3599 100644 --- a/debug-viewer/GstDebugViewer/Plugins/Timeline.py +++ b/debug-viewer/GstDebugViewer/Plugins/Timeline.py @@ -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)