dashdemux: avoid assertion when splitting buffer

Pass size=-1 as is if that is the case instead of subtracting
the offset. Otherwise we have an invalid size passed for that
buffer.
This commit is contained in:
Thiago Santos 2015-05-29 09:01:29 -03:00
parent ed21506896
commit 53451500ee

View file

@ -1316,7 +1316,7 @@ _gst_buffer_split (GstBuffer * buffer, gint offset, gsize size)
{ {
GstBuffer *newbuf = gst_buffer_copy_region (buffer, GstBuffer *newbuf = gst_buffer_copy_region (buffer,
GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS | GST_BUFFER_COPY_META GST_BUFFER_COPY_FLAGS | GST_BUFFER_COPY_TIMESTAMPS | GST_BUFFER_COPY_META
| GST_BUFFER_COPY_MEMORY, offset, size - offset); | GST_BUFFER_COPY_MEMORY, offset, size == -1 ? size : size - offset);
gst_buffer_resize (buffer, 0, offset); gst_buffer_resize (buffer, 0, offset);