[vlc-commits] flac: check block allocation

Hannes Domani git at videolan.org
Tue Sep 2 20:24:16 CEST 2014


vlc | branch: master | Hannes Domani <ssbssa at yahoo.de> | Tue Sep  2 18:47:23 2014 +0200| [7459d06cca4cd0fa29eec101001628d34549c6d1] | committer: Tristan Matthews

flac: check block allocation

Signed-off-by: Tristan Matthews <le.businessman at gmail.com>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7459d06cca4cd0fa29eec101001628d34549c6d1
---

 modules/codec/flac.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/flac.c b/modules/codec/flac.c
index e226f19..f2e3cda 100644
--- a/modules/codec/flac.c
+++ b/modules/codec/flac.c
@@ -400,6 +400,7 @@ static void ProcessHeader( decoder_t *p_dec )
     switch (i_extra) {
     case 34:
         p_sys->p_block = block_Alloc( 8 + i_extra );
+        if( p_sys->p_block == NULL ) return;
         memcpy( p_sys->p_block->p_buffer + 8, p_dec->fmt_in.p_extra, i_extra );
         memcpy( p_sys->p_block->p_buffer, header, 4);
         uint8_t *p = p_sys->p_block->p_buffer;
@@ -410,6 +411,7 @@ static void ProcessHeader( decoder_t *p_dec )
         break;
     case 42:
         p_sys->p_block = block_Alloc( i_extra );
+        if( p_sys->p_block == NULL ) return;
         memcpy( p_sys->p_block->p_buffer, p_dec->fmt_in.p_extra, i_extra );
         break;
     default:



More information about the vlc-commits mailing list