[vlc-commits] [Git][videolan/vlc][master] ogg: fix memory allocation check
Jean-Baptiste Kempf (@jbk)
gitlab at videolan.org
Thu Oct 7 14:21:21 UTC 2021
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
19fc95b3 by Alexandre Janniaux at 2021-10-07T13:40:28+00:00
ogg: fix memory allocation check
The check was done on the value of the memory allocated and not the
memory allocated itself, leading to uninitialized warnings from the
compilers and potential NULL dereference in case of memory allocation
failure, or random errors in case the memory has been correctly
allocated but is initialized to zero.
- - - - -
1 changed file:
- modules/demux/ogg.c
Changes:
=====================================
modules/demux/ogg.c
=====================================
@@ -747,7 +747,7 @@ static int Control( demux_t *p_demux, int i_query, va_list args )
return VLC_EGENERIC;
*ppp_attach = vlc_alloc( p_sys->i_attachments, sizeof(input_attachment_t*) );
- if (!**ppp_attach)
+ if (!*ppp_attach)
return VLC_ENOMEM;
*pi_int = p_sys->i_attachments;
for( int i = 0; i < p_sys->i_attachments; i++ )
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/19fc95b3eace9f53dbfebdfcfc53af2fa48551ad
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/19fc95b3eace9f53dbfebdfcfc53af2fa48551ad
You're receiving this email because of your account on code.videolan.org.
More information about the vlc-commits
mailing list