[vlc-devel] [PATCH 01/19] demux/mp4: SetupAudioES: add missing error-check

Filip Roséen filip at atch.se
Thu May 18 12:16:55 CEST 2017


The changes introduced in 08a2eb61 correctly adds a new block for
reading from p_extra, it however left out the if-condition to protect
said block.

These changes fixes that.
---
 modules/demux/mp4/essetup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/demux/mp4/essetup.c b/modules/demux/mp4/essetup.c
index e499c6b03f..cc53143881 100644
--- a/modules/demux/mp4/essetup.c
+++ b/modules/demux/mp4/essetup.c
@@ -913,6 +913,7 @@ int SetupAudioES( demux_t *p_demux, mp4_track_t *p_track, MP4_Box_t *p_sample )
             {
                 size_t i_extra = p_dfLa->data.p_binary->i_blob;
                 uint8_t *p_extra = malloc(i_extra);
+                if( likely( p_extra ) )
                 {
                     p_track->fmt.i_extra = i_extra;
                     p_track->fmt.p_extra = p_extra;
-- 
2.12.2


More information about the vlc-devel mailing list