Re: [FFmpeg-devel] [PATCH v2 11/17] avutil/mem: Add av_fast_realloc_array()

2020-01-01 Thread Nicolas George
Andreas Rheinhardt (12020-01-01): > What has > not been done is switching to size_t. This function can still be turned > into a wrapper for a size_t function if the need for such a function > arises. I do not agree with that. size_t is the correct type for that use, and therefore should be the cho

[FFmpeg-devel] [PATCH v2 11/17] avutil/mem: Add av_fast_realloc_array()

2020-01-01 Thread Andreas Rheinhardt
This is an array-equivalent of av_fast_realloc(). Its advantages compared to using av_fast_realloc() for allocating arrays are as follows: a) It performs its own overflow checks for the multiplication that is implicit in array allocations. (And it only needs to perform these checks (as well as the