mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-20 04:56:24 +00:00
rtpsource: fix memleak
Don't leak the input buffer when the received and expected seqnum are different when in probation. fixes #594039
This commit is contained in:
parent
f542f710cf
commit
371875c57a
1 changed files with 11 additions and 6 deletions
|
@ -973,6 +973,7 @@ rtp_source_process_rtp (RTPSource * src, GstBuffer * buffer,
|
||||||
GstFlowReturn result = GST_FLOW_OK;
|
GstFlowReturn result = GST_FLOW_OK;
|
||||||
guint16 seqnr, udelta;
|
guint16 seqnr, udelta;
|
||||||
RTPSourceStats *stats;
|
RTPSourceStats *stats;
|
||||||
|
guint16 expected;
|
||||||
|
|
||||||
g_return_val_if_fail (RTP_IS_SOURCE (src), GST_FLOW_ERROR);
|
g_return_val_if_fail (RTP_IS_SOURCE (src), GST_FLOW_ERROR);
|
||||||
g_return_val_if_fail (GST_IS_BUFFER (buffer), 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 we are still on probation, check seqnum */
|
||||||
if (src->probation) {
|
if (src->probation) {
|
||||||
guint16 expected;
|
|
||||||
|
|
||||||
expected = src->stats.max_seq + 1;
|
expected = src->stats.max_seq + 1;
|
||||||
|
|
||||||
/* when in probation, we require consecutive seqnums */
|
/* when in probation, we require consecutive seqnums */
|
||||||
|
@ -1022,10 +1021,8 @@ rtp_source_process_rtp (RTPSource * src, GstBuffer * buffer,
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
GST_DEBUG ("probation: seqnr %d != expected %d", seqnr, expected);
|
/* unexpected seqnum in probation */
|
||||||
src->probation = RTP_DEFAULT_PROBATION;
|
goto probation_seqnum;
|
||||||
src->stats.max_seq = seqnr;
|
|
||||||
goto done;
|
|
||||||
}
|
}
|
||||||
} else if (udelta < RTP_MAX_DROPOUT) {
|
} else if (udelta < RTP_MAX_DROPOUT) {
|
||||||
/* in order, with permissible gap */
|
/* in order, with permissible gap */
|
||||||
|
@ -1077,6 +1074,14 @@ bad_sequence:
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
return GST_FLOW_OK;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue