Re: [FFmpeg-devel] [PATCH 2/3] avutil/dict: Improve appending values

2022-09-14 Thread Paul B Mahol
On 9/13/22, Andreas Rheinhardt wrote: > When appending two values (due to AV_DICT_APPEND), the earlier code > would first zero-allocate a buffer of the required size and then > copy both parts into it via av_strlcat(). This is problematic, > as it leads to quadratic performance in case of frequent

[FFmpeg-devel] [PATCH 2/3] avutil/dict: Improve appending values

2022-09-13 Thread Andreas Rheinhardt
When appending two values (due to AV_DICT_APPEND), the earlier code would first zero-allocate a buffer of the required size and then copy both parts into it via av_strlcat(). This is problematic, as it leads to quadratic performance in case of frequent enlargements. Fix this by using av_realloc() (