diff options
author | Richard Mudgett <rmudgett@digium.com> | 2017-05-02 18:05:01 -0500 |
---|---|---|
committer | Richard Mudgett <rmudgett@digium.com> | 2017-05-05 18:49:19 -0500 |
commit | 56c5c51076ac75e25130083d1358160cd27b0b8f (patch) | |
tree | 3d271882e9fd1a0122ab1a1dafee0bfd79a8a370 /main/stream.c | |
parent | 924628812b68e01cf7506b44b292e6057716f77a (diff) |
stream: ast_stream_clone() cannot copy the opaque user data.
ast_stream_clone() cannot copy the opaque user data stored on a stream.
We don't know how to clone the data so it isn't copied into the clone.
Change-Id: Ia51321bf38ecbfdcc53787ca77ea5fd2cabdf367
Diffstat (limited to 'main/stream.c')
-rw-r--r-- | main/stream.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/main/stream.c b/main/stream.c index 0f2393359..804a0b8ee 100644 --- a/main/stream.c +++ b/main/stream.c @@ -99,6 +99,7 @@ struct ast_stream *ast_stream_clone(const struct ast_stream *stream) { struct ast_stream *new_stream; size_t stream_size; + int idx; if (!stream) { return NULL; @@ -115,6 +116,12 @@ struct ast_stream *ast_stream_clone(const struct ast_stream *stream) ao2_ref(new_stream->formats, +1); } + /* We cannot clone the opaque data because we don't know how. */ + for (idx = 0; idx < AST_STREAM_DATA_SLOT_MAX; ++idx) { + new_stream->data[idx] = NULL; + new_stream->data_free_fn[idx] = NULL; + } + return new_stream; } |