baseparse: fix invalid memory access in debug messages

Don't use buffers that we've given away or unrefed in debug messages.
This commit is contained in:
Tim-Philipp Müller 2011-07-07 14:57:18 +01:00
parent 0993102834
commit f47c3472df

View file

@ -1925,9 +1925,10 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
ret = GST_FLOW_OK;
} else if (ret == GST_FLOW_OK) {
if (parse->segment.rate > 0.0) {
ret = gst_pad_push (parse->srcpad, buffer);
GST_LOG_OBJECT (parse, "frame (%d bytes) pushed: %s",
GST_LOG_OBJECT (parse, "pushing frame (%d bytes) now..",
GST_BUFFER_SIZE (buffer), gst_flow_get_name (ret));
ret = gst_pad_push (parse->srcpad, buffer);
GST_LOG_OBJECT (parse, "frame pushed, flow %s", gst_flow_get_name (ret));
} else {
GST_LOG_OBJECT (parse, "frame (%d bytes) queued for now",
GST_BUFFER_SIZE (buffer));
@ -1936,9 +1937,9 @@ gst_base_parse_push_frame (GstBaseParse * parse, GstBaseParseFrame * frame)
ret = GST_FLOW_OK;
}
} else {
gst_buffer_unref (buffer);
GST_LOG_OBJECT (parse, "frame (%d bytes) not pushed: %s",
GST_BUFFER_SIZE (buffer), gst_flow_get_name (ret));
gst_buffer_unref (buffer);
/* if we are not sufficiently in control, let upstream decide on EOS */
if (ret == GST_FLOW_UNEXPECTED &&
(parse->priv->passthrough ||