summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_mpeg2_syntax_template.c
diff options
context:
space:
mode:
authorMark Thompson <sw@jkqxz.net>2018-02-21 22:22:54 +0000
committerMark Thompson <sw@jkqxz.net>2018-02-21 22:22:54 +0000
commit0cc8e34a94c84132cf5b0f6472c5f61c8a66cee1 (patch)
tree36c8a457e098ff96367b96c67ea2ce036fc31f30 /libavcodec/cbs_mpeg2_syntax_template.c
parentb656fa710a34ec7c3b192c38344a2c470ff2eaf5 (diff)
parentce5870a3a8f2b10668ee4f04c2ae0287f66f31b2 (diff)
Merge commit 'ce5870a3a8f2b10668ee4f04c2ae0287f66f31b2'
* commit 'ce5870a3a8f2b10668ee4f04c2ae0287f66f31b2': cbs: Refcount all the things! Some changes for bitstream API. Merged-by: Mark Thompson <sw@jkqxz.net>
Diffstat (limited to 'libavcodec/cbs_mpeg2_syntax_template.c')
-rw-r--r--libavcodec/cbs_mpeg2_syntax_template.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/cbs_mpeg2_syntax_template.c b/libavcodec/cbs_mpeg2_syntax_template.c
index 90dde26aed..51c32cb58d 100644
--- a/libavcodec/cbs_mpeg2_syntax_template.c
+++ b/libavcodec/cbs_mpeg2_syntax_template.c
@@ -71,9 +71,10 @@ static int FUNC(user_data)(CodedBitstreamContext *ctx, RWContext *rw,
av_assert0(k % 8 == 0);
current->user_data_length = k /= 8;
if (k > 0) {
- current->user_data = av_malloc(k);
- if (!current->user_data)
+ current->user_data_ref = av_buffer_alloc(k);
+ if (!current->user_data_ref)
return AVERROR(ENOMEM);
+ current->user_data = current->user_data_ref->data;
}
#endif