[FFmpeg-devel] [PATCH] avformat/assenc: fix incorrect copy of null terminator

Tim Angus tim at ngus.net
Tue Jan 31 15:37:02 EET 2023


On 31/01/2023 12:37, "zhilizhao(赵志立)" wrote:
>> +        /* extradata may or may not be null terminated; in the case where
>> +         * it is, avoid copying a null into the middle of the buffer */
>> +        while (header_size > 0 && par->extradata[header_size - 1] == '\0')
>> +            header_size--;
>> +
> The comment is misleading. extradata is always null terminated, although
> those paddings don’t count in extradata_size.

That's a bit pedantic, but I take your point. "The contents of extradata 
may or may..." would be better. Following some discussion on IRC, I've 
actually submitted another patch that solves the problem in a different 
way, but I don't think anyone has looked at it yet...

http://ffmpeg.org/pipermail/ffmpeg-devel/2023-January/306017.html


More information about the ffmpeg-devel mailing list