[FFmpeg-devel] [PATCH v5 2/2] avutil: add HDR10+ dynamic metadata serialization function

Raphaël Zumer raphael.zumer at vimeo.com
Tue Mar 14 01:30:41 EET 2023


On 3/13/23 19:25, James Almer wrote:
>>> You are allocating without any padding. This implies that one could not
>>> use this buffer with our GetBit-API or in other places where one needed
>>> a padded buffer.
>> Is there any comparable code that does that? I feel like padding a buffer should be the responsibility of the caller for a public function, otherwise the user has to be aware of the padding to avoid embedding extra payload bytes accidentally (even though it is negligible in size), it is an extra manipulation if padding is not needed, and requires including an extra file to access the padding size.
> The returned value in *size would not take the padding bytes into 
> account, so no way to include them accidentally anywhere. You either 
> know the size of the serialized data and trust the buffer is complete as 
> Andreas mentioned, or you read the size returned by the function. In 
> either case, the padding bytes are never considered.

Right, I did not think it through. Will do.

RZ




More information about the ffmpeg-devel mailing list