[vlc-commits] shine: avoid double free

Tristan Matthews git at videolan.org
Sun Mar 22 23:03:11 CET 2015


vlc | branch: master | Tristan Matthews <tmatth at videolan.org> | Sun Mar 22 17:42:19 2015 -0400| [98748a4a98cefe26451a93b6deb646dbdb8d4366] | committer: Tristan Matthews

shine: avoid double free

If subsequent malloc or realloc failed, free would be called on a dangling
pointer.

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

 modules/codec/shine.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/modules/codec/shine.c b/modules/codec/shine.c
index e65b737..0b46c8c 100644
--- a/modules/codec/shine.c
+++ b/modules/codec/shine.c
@@ -176,6 +176,7 @@ static block_t *GetPCM( encoder_t *p_enc, block_t *p_block )
             i_buffer = p_sys->i_buffer;
             p_sys->i_buffer = 0;
             free( p_sys->p_buffer );
+            p_sys->p_buffer = NULL;
         }
 
         memcpy( p_pcm_block->p_buffer + i_buffer,



More information about the vlc-commits mailing list