From 5bfc92714e6b289be32d79cefc78906a8190a6ec Mon Sep 17 00:00:00 2001 From: Andoni Morales Alastruey Date: Thu, 25 Nov 2010 17:14:23 +0100 Subject: [PATCH] audioparse: fix possible division-by-zero https://bugzilla.gnome.org/show_bug.cgi?id=635786 --- gst/audioparsers/gstbaseparse.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c index 19ecb708f8..53402f5909 100644 --- a/gst/audioparsers/gstbaseparse.c +++ b/gst/audioparsers/gstbaseparse.c @@ -1131,7 +1131,7 @@ gst_base_parse_update_bitrates (GstBaseParse * parse, GstBuffer * buffer) /* duration should be valid by now, * either set by subclass or maybe based on fps settings */ - if (GST_BUFFER_DURATION_IS_VALID (buffer)) { + if (GST_BUFFER_DURATION_IS_VALID (buffer) && parse->priv->acc_duration != 0) { /* Calculate duration of a frame from buffer properties */ frame_dur = GST_BUFFER_DURATION (buffer); parse->priv->avg_bitrate = (8 * parse->priv->data_bytecount * GST_SECOND) /