From 7936a2180e91fe999c804e34d50cd5606df4827a Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Wed, 30 May 2012 17:52:50 +0200 Subject: [PATCH] avoid division by zero --- pandora/item/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandora/item/models.py b/pandora/item/models.py index f4f9c25c..14c42008 100644 --- a/pandora/item/models.py +++ b/pandora/item/models.py @@ -1039,7 +1039,8 @@ class Item(models.Model): color = map(lambda a,b: (a+b)/n, color,ox.image.getRGB(s.color)) offset += s.duration self.data['color'] = ox.image.getHSL(color) - self.data['volume'] /= offset + if offset: + self.data['volume'] /= offset #extract.timeline_strip(self, self.data['cuts'], stream.info, self.timeline_prefix[:-8]) self.select_frame() self.make_poster(True)