X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Fcbs_mpeg2_syntax_template.c;h=88cf453b17f949ef57fb7b60cc3b2608f8f4d124;hb=e2f766e13f0350017a0c3c7111b54cda7317e500;hp=8b5d35437e9b9c6a1d5b486314a997b24a87afe0;hpb=0ff76ca86e0ea4dcf2b392c45f5fac8e5576bb0d;p=ffmpeg diff --git a/libavcodec/cbs_mpeg2_syntax_template.c b/libavcodec/cbs_mpeg2_syntax_template.c index 8b5d35437e9..88cf453b17f 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;