[vlc-devel] [PATCH] lib: media_track: Add missing allocation checks
Romain Vimont
rom1v at videolabs.io
Fri Jun 12 17:23:26 CEST 2020
LGTM
On Fri, Jun 12, 2020 at 12:43:09PM +0200, Hugo Beauzée-Luyssen wrote:
> ---
> lib/media_track.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/lib/media_track.c b/lib/media_track.c
> index feca38f7ef..d9cb7932a7 100644
> --- a/lib/media_track.c
> +++ b/lib/media_track.c
> @@ -177,7 +177,7 @@ libvlc_media_tracklist_from_es_array( es_format_t **es_array,
>
> libvlc_media_tracklist_t *list = libvlc_media_tracklist_alloc( count );
>
> - if( count == 0 )
> + if( count == 0 || list == NULL )
> return list;
>
> count = 0;
> @@ -232,6 +232,9 @@ libvlc_media_tracklist_from_player( vlc_player_t *player,
> size_t count = vlc_player_GetTrackCount( player, cat );
> libvlc_media_tracklist_t *list = libvlc_media_tracklist_alloc( count );
>
> + if( !list )
> + return NULL;
> +
> for( size_t i = 0; i < count; ++i )
> {
> const struct vlc_player_track *track =
> --
> 2.20.1
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list