[gst-cvs] gst-plugins-bad: audioparse: fix possible division-by-zero

Edward Hervey bilboed at kemper.freedesktop.org
Thu Nov 25 08:28:24 PST 2010


Module: gst-plugins-bad
Branch: master
Commit: bc3917bb04aa900a9020c636e002b67d93797715
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=bc3917bb04aa900a9020c636e002b67d93797715

Author: Andoni Morales Alastruey <amorales at flumotion.com>
Date:   Thu Nov 25 17:14:23 2010 +0100

audioparse: fix possible division-by-zero

https://bugzilla.gnome.org/show_bug.cgi?id=635786

---

 gst/audioparsers/gstbaseparse.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/gst/audioparsers/gstbaseparse.c b/gst/audioparsers/gstbaseparse.c
index 19ecb70..53402f5 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) /





More information about the Gstreamer-commits mailing list