]> git.sesse.net Git - vlc/commitdiff
shine: avoid double free
authorTristan Matthews <tmatth@videolan.org>
Sun, 22 Mar 2015 21:42:19 +0000 (17:42 -0400)
committerTristan Matthews <tmatth@videolan.org>
Sun, 22 Mar 2015 21:42:19 +0000 (17:42 -0400)
If subsequent malloc or realloc failed, free would be called on a dangling
pointer.

modules/codec/shine.c

index e65b737df26a5d24caf11cbe1a8c46d3aa096d64..0b46c8c57cc751ecc828ed358d654705d95eaedd 100644 (file)
@@ -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,