From ae05ed4f058dc9a6884c874e64ee3dcdb656e90e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 1 May 2013 15:49:45 +0200 Subject: [PATCH] rtph264pay: If the adapter is empty on EOS don't try to map its content https://bugzilla.gnome.org/show_bug.cgi?id=699314 --- gst/rtp/gstrtph264pay.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c index 5af7f0d..1929117 100644 --- a/gst/rtp/gstrtph264pay.c +++ b/gst/rtp/gstrtph264pay.c @@ -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, -- 2.7.4