Commit ac4b4c89 authored by Rafaël Carré's avatar Rafaël Carré Committed by Jean-Paul Saman

Fix error path of AllocateBuffer()

Signed-off-by: Jean-Paul Saman's avatarJean-Paul Saman <jean-paul.saman@m2x.nl>
parent b38c7942
......@@ -140,23 +140,20 @@ int __AllocateBuffer( vlc_object_t *p_this, XDAS_Int32 i_num,
for( i = 0; i < i_num; i++ )
{
#ifdef DEBUG_DAVINCI
msg_Info( p_this, " %d: size %d Bytes", i, (int)pi_sizes[i] );
msg_Info( p_this, "\t%d: size %d Bytes", i, (int)pi_sizes[i] );
#endif
buf->bufSizes[i] = pi_sizes[i];
buf->bufs[i] = Memory_contigAlloc( pi_sizes[i], Memory_DEFAULTALIGNMENT );
if( !buf->bufs[i] )
{
#ifdef DEBUG_DAVINCI
msg_Err( p_this, "Failed to allocate buffer" );
#endif
for( i--; i >= 0; i-- )
{
Memory_contigFree( buf->bufs[i], buf->bufSizes[i] );
free( buf->bufs );
free( buf->bufSizes );
buf->numBufs = 0;
return VLC_ENOMEM;
}
free( buf->bufs );
free( buf->bufSizes );
buf->numBufs = 0;
return VLC_ENOMEM;
}
}
return VLC_SUCCESS;
......
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