[FFmpeg-devel] [PATCH 6/7] avformat/dashenc: add missing padding to the updated extradata
James Almer
jamrial at gmail.com
Mon Aug 5 18:43:51 EEST 2019
On 8/5/2019 12:42 PM, Paul B Mahol wrote:
> On Fri, Aug 2, 2019 at 5:07 PM James Almer <jamrial at gmail.com> wrote:
>
>> On 8/2/2019 11:46 AM, Andreas Rheinhardt wrote:
>>> James Almer:
>>>> Signed-off-by: James Almer <jamrial at gmail.com>
>>>> ---
>>>> libavformat/dashenc.c | 3 ++-
>>>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/libavformat/dashenc.c b/libavformat/dashenc.c
>>>> index bded260806..50eba370d9 100644
>>>> --- a/libavformat/dashenc.c
>>>> +++ b/libavformat/dashenc.c
>>>> @@ -1476,12 +1476,13 @@ static int
>> update_stream_extradata(AVFormatContext *s, OutputStream *os,
>>>> if (!extradata_size)
>>>> return 0;
>>>>
>>>> - new_extradata = av_malloc(extradata_size);
>>>> + new_extradata = av_malloc(extradata_size +
>> AV_INPUT_BUFFER_PADDING_SIZE);
>>>>
>>>> if (!new_extradata)
>>>> return AVERROR(ENOMEM);
>>>>
>>>> memcpy(new_extradata, extradata, extradata_size);
>>>> + memset(new_extradata + extradata_size, 0,
>> AV_INPUT_BUFFER_PADDING_SIZE);
>>>>
>>>> os->ctx->streams[0]->codecpar->extradata = new_extradata;
>>>> os->ctx->streams[0]->codecpar->extradata_size = extradata_size;
>>>>
>>> Is there a reason you are not using ff_alloc_extradata?
>>>
>>> - Andreas
>>
>> Not really. I can replace this patch with one implementing
>> ff_alloc_extradata().
>>
>
> Please do so, less code :)
Already did and pushed it last Saturday :p
More information about the ffmpeg-devel
mailing list