rtph264pay: If the adapter is empty on EOS don't try to map its content
authorSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 1 May 2013 13:49:45 +0000 (15:49 +0200)
committerSebastian Dröge <sebastian.droege@collabora.co.uk>
Wed, 1 May 2013 13:49:45 +0000 (15:49 +0200)
https://bugzilla.gnome.org/show_bug.cgi?id=699314

gst/rtp/gstrtph264pay.c

index 5af7f0d..1929117 100644 (file)
@@ -1073,6 +1073,9 @@ gst_rtp_h264_pay_handle_buffer (GstRTPBasePayload * basepayload,
       gst_adapter_push (rtph264pay->adapter, buffer);
     }
     size = gst_adapter_available (rtph264pay->adapter);
+    /* Nothing to do here if the adapter is empty, e.g. on EOS */
+    if (size == 0)
+      return GST_FLOW_OK;
     data = gst_adapter_map (rtph264pay->adapter, size);
     GST_DEBUG_OBJECT (basepayload,
         "got %" G_GSIZE_FORMAT " bytes (%" G_GSIZE_FORMAT ")", size,