summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Glayal <spglegle at yahoo.fr>2009-09-03 19:37:10 +0200
committerWim Taymans <wim.taymans@collabora.co.uk>2009-09-03 19:37:10 +0200
commit371875c57abcf189c29565d8e2b448be47bfe30d (patch)
tree23b1d10c0bcf3a7be89054aa3cd8ef192594e4d3
parentf542f710cfa2bc893417f469b127e467744adbf7 (diff)
rtpsource: fix memleak
Don't leak the input buffer when the received and expected seqnum are different when in probation. fixes #594039
-rw-r--r--gst/rtpmanager/rtpsource.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/gst/rtpmanager/rtpsource.c b/gst/rtpmanager/rtpsource.c
index fb8b98481..03e5ae590 100644
--- a/gst/rtpmanager/rtpsource.c
+++ b/gst/rtpmanager/rtpsource.c
@@ -973,6 +973,7 @@ rtp_source_process_rtp (RTPSource * src, GstBuffer * buffer,
GstFlowReturn result = GST_FLOW_OK;
guint16 seqnr, udelta;
RTPSourceStats *stats;
+ guint16 expected;
g_return_val_if_fail (RTP_IS_SOURCE (src), GST_FLOW_ERROR);
g_return_val_if_fail (GST_IS_BUFFER (buffer), GST_FLOW_ERROR);
@@ -995,8 +996,6 @@ rtp_source_process_rtp (RTPSource * src, GstBuffer * buffer,
/* if we are still on probation, check seqnum */
if (src->probation) {
- guint16 expected;
-
expected = src->stats.max_seq + 1;
/* when in probation, we require consecutive seqnums */
@@ -1022,10 +1021,8 @@ rtp_source_process_rtp (RTPSource * src, GstBuffer * buffer,
goto done;
}
} else {
- GST_DEBUG ("probation: seqnr %d != expected %d", seqnr, expected);
- src->probation = RTP_DEFAULT_PROBATION;
- src->stats.max_seq = seqnr;
- goto done;
+ /* unexpected seqnum in probation */
+ goto probation_seqnum;
}
} else if (udelta < RTP_MAX_DROPOUT) {
/* in order, with permissible gap */
@@ -1077,6 +1074,14 @@ bad_sequence:
gst_buffer_unref (buffer);
return GST_FLOW_OK;
}
+probation_seqnum:
+ {
+ GST_WARNING ("probation: seqnr %d != expected %d", seqnr, expected);
+ src->probation = RTP_DEFAULT_PROBATION;
+ src->stats.max_seq = seqnr;
+ gst_buffer_unref (buffer);
+ return GST_FLOW_OK;
+ }
}
/**