[vlc-devel] [PATCH 06/12] picture_pool: Don't use VLAs
Romain Vimont
rom1v at videolabs.io
Tue Dec 8 15:39:40 CET 2020
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.
More information about the vlc-devel
mailing list