[vlc-devel] [PATCH 06/12] picture_pool: Don't use VLAs

Steve Lhomme robux4 at ycbcr.xyz
Tue Dec 8 15:47:14 CET 2020


On 2020-12-08 15:39, Romain Vimont wrote:
> On Tue, Dec 08, 2020 at 03:19:10PM +0100, Hugo Beauzée-Luyssen wrote:
>> ---
>>   src/misc/picture_pool.c | 12 ++++++++++--
>>   1 file changed, 10 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
>> index d2df4bf2eb..7ebaf00eaa 100644
>> --- a/src/misc/picture_pool.c
>> +++ b/src/misc/picture_pool.c
>> @@ -128,7 +128,9 @@ picture_pool_t *picture_pool_New(unsigned count, picture_t *const *tab)
>>   picture_pool_t *picture_pool_NewFromFormat(const video_format_t *fmt,
>>                                              unsigned count)
>>   {
>> -    picture_t *picture[count ? count : 1];
>> +    picture_t **picture = malloc(sizeof(*picture) * (count ? count : 1));
> 
> Maybe "assert(count);" would be better.

+1


More information about the vlc-devel mailing list