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 e65b737..0b46c8c 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,