summaryrefslogtreecommitdiff
path: root/libavcodec/cbs_mpeg2_syntax_template.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/cbs_mpeg2_syntax_template.c')
-rw-r--r--libavcodec/cbs_mpeg2_syntax_template.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/cbs_mpeg2_syntax_template.c b/libavcodec/cbs_mpeg2_syntax_template.c
index 8b5d35437e..88cf453b17 100644
--- a/libavcodec/cbs_mpeg2_syntax_template.c
+++ b/libavcodec/cbs_mpeg2_syntax_template.c
@@ -71,7 +71,7 @@ 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_ref = av_buffer_alloc(k);
+ current->user_data_ref = av_buffer_allocz(k + AV_INPUT_BUFFER_PADDING_SIZE);
if (!current->user_data_ref)
return AVERROR(ENOMEM);
current->user_data = current->user_data_ref->data;