Commit 845744d3 authored by Diego Biurrun's avatar Diego Biurrun
Browse files

css: Check the return value of a malloc() invocation

This prevents a possible NULL pointer dereference further along.
parent f40f3803
......@@ -297,6 +297,10 @@ int dvdcss_title ( dvdcss_t dvdcss, int i_block )
/* Write in the new title and its key */
p_newtitle = malloc( sizeof( dvd_title_t ) );
if( p_newtitle == NULL )
{
return -1;
}
p_newtitle->i_startlb = i_block;
memcpy( p_newtitle->p_key, p_title_key, KEY_SIZE );
......
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