Commit 1ceb58c1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix block_New failure check

parent db7c8885
......@@ -133,6 +133,8 @@ VLC_EXPORT( block_t *, block_Realloc, ( block_t *, int i_pre, int i_body )
static inline block_t *block_Duplicate( block_t *p_block )
{
block_t *p_dup = block_New( p_block->p_manager, p_block->i_buffer );
if( p_dup == NULL )
return NULL;
p_dup->i_dts = p_block->i_dts;
p_dup->i_pts = p_block->i_pts;
......@@ -140,9 +142,7 @@ static inline block_t *block_Duplicate( block_t *p_block )
p_dup->i_length = p_block->i_length;
p_dup->i_rate = p_block->i_rate;
p_dup->i_samples = p_block->i_samples;
if( p_dup && p_block->i_buffer > 0 )
memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer );
memcpy( p_dup->p_buffer, p_block->p_buffer, p_block->i_buffer );
return p_dup;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment