diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-06-24 10:52:02 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-06-24 10:52:56 +0200 |
commit | d78b9a5adaf7f0c875caab3145a1b6ae6acd18df (patch) | |
tree | 5902d7b2d4469de1ca633489b835b84f75c5c5a9 /gst | |
parent | 7ecef53dbb46c5938ef3019fcf79f162c3caa845 (diff) |
bufferlist: Warn if copying a buffer fails in gst_buffer_list_copy_deep()
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstbufferlist.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/gst/gstbufferlist.c b/gst/gstbufferlist.c index 2ae3f2f48..dabcd6a98 100644 --- a/gst/gstbufferlist.c +++ b/gst/gstbufferlist.c @@ -389,7 +389,16 @@ gst_buffer_list_copy_deep (const GstBufferList * list) len = list->n_buffers; for (i = 0; i < len; i++) { GstBuffer *old = list->buffers[i]; - gst_buffer_list_insert (result, i, gst_buffer_copy_deep (old)); + GstBuffer *new = gst_buffer_copy_deep (old); + + if (G_LIKELY (new)) { + gst_buffer_list_insert (result, i, new); + } else { + g_warning + ("Failed to deep copy buffer %p while deep " + "copying buffer list %p. Buffer list copy " + "will be incomplete", old, list); + } } return result; |