gst-libs/gst/rtp/gstrtpbuffer.c: with regular return and warning.
authorStefan Kost <ensonic@users.sourceforge.net>
Thu, 4 Oct 2007 06:50:53 +0000 (06:50 +0000)
committerStefan Kost <ensonic@users.sourceforge.net>
Thu, 4 Oct 2007 06:50:53 +0000 (06:50 +0000)
Original commit message from CVS:
* gst-libs/gst/rtp/gstrtpbuffer.c:
Replace g_return_if_val (as it could be disabled), with regular return
and warning.

ChangeLog
gst-libs/gst/rtp/gstrtpbuffer.c

index d1c0d78..d9fb73c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-10-04  Stefan Kost  <ensonic@users.sf.net>
+
+       * gst-libs/gst/rtp/gstrtpbuffer.c:
+         Replace g_return_if_val (as it could be disabled), with regular return
+         and warning.
+
 2007-10-03  Stefan Kost  <ensonic@users.sf.net>
 
        * tests/check/pipelines/simple-launch-lines.c:
index e6bc817..3b11cd7 100644 (file)
@@ -875,7 +875,10 @@ gst_rtp_buffer_get_payload_subbuffer (GstBuffer * buffer, guint offset,
 
   plen = gst_rtp_buffer_get_payload_len (buffer);
   /* we can't go past the length */
-  g_return_val_if_fail (offset < plen, NULL);
+  if (G_UNLIKELY (offset < plen)) {
+    GST_WARNING ("offset=%u should be less then plen=%u", offset, plen);
+    return (NULL);
+  }
 
   /* apply offset */
   poffset = gst_rtp_buffer_get_header_len (buffer) + offset;