Commit b7ae5136 authored by François Cartegnie's avatar François Cartegnie 🤞

packetizer: hevc/h264: set result size to 0 on alloc failure

parent 3629fd9e
......@@ -82,7 +82,10 @@ uint8_t *h264_avcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
uint8_t *p_ret;
uint8_t *p_out_buf = p_ret = malloc( *pi_result );
if( !p_out_buf )
{
*pi_result = 0;
return NULL;
}
p_buf += 5;
......
......@@ -77,7 +77,10 @@ uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf,
uint8_t *p_ret;
uint8_t *p_out_buf = p_ret = malloc( *pi_result );
if( !p_out_buf )
{
*pi_result = 0;
return NULL;
}
const uint8_t i_num_array = p_buf[22];
p_buf += 23;
......
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