From 3a09d334a09b98f3f0601b71ffaec7f7ba8290aa Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 22 Feb 2010 12:24:14 +0100 Subject: [PATCH] rtpmp4gdepay: avoid division by 0 Avoid a division by 0 when no constantDuration was specified and when out two timestamps are equal. Fixes #610265 --- gst/rtp/gstrtpmp4gdepay.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gst/rtp/gstrtpmp4gdepay.c b/gst/rtp/gstrtpmp4gdepay.c index 887a917..939e3f1 100644 --- a/gst/rtp/gstrtpmp4gdepay.c +++ b/gst/rtp/gstrtpmp4gdepay.c @@ -546,8 +546,12 @@ gst_rtp_mp4g_depay_process (GstBaseRTPDepayload * depayload, GstBuffer * buf) rtpmp4gdepay->constantDuration); } - /* get the number of packets by dividing with the duration */ - diff /= rtpmp4gdepay->constantDuration; + if (rtpmp4gdepay->constantDuration > 0) { + /* get the number of packets by dividing with the duration */ + diff /= rtpmp4gdepay->constantDuration; + } else { + diff = 0; + } rtpmp4gdepay->last_AU_index += diff; rtpmp4gdepay->prev_AU_index = AU_index; -- 2.7.4