mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
basetransform: Handle downstream giving a buffer with new caps but invalid size
This can happen for example when downstream proposed new caps, later proposed the previous caps again which in turn enables passthrough mode in upstream elements and the wrong-sized buffer appears in an element where the caps change never happened. Simply allocate a new buffer in this case. See bug #635461.
This commit is contained in:
parent
eb56687a6d
commit
0a74684b41
1 changed files with 6 additions and 0 deletions
|
@ -1489,6 +1489,12 @@ gst_base_transform_prepare_output_buffer (GstBaseTransform * trans,
|
|||
gst_buffer_unref (*out_buf);
|
||||
*out_buf = NULL;
|
||||
}
|
||||
} else if (outsize != newsize) {
|
||||
GST_WARNING_OBJECT (trans, "Caps did not change but allocated size does "
|
||||
"not match expected size (%d != %d)", newsize, outsize);
|
||||
if (in_buf != *out_buf)
|
||||
gst_buffer_unref (*out_buf);
|
||||
*out_buf = NULL;
|
||||
}
|
||||
|
||||
/* these are the final output caps */
|
||||
|
|
Loading…
Reference in a new issue