Commit b7ae5136 authored by Francois Cartegnie's avatar Francois 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, ...@@ -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_ret;
uint8_t *p_out_buf = p_ret = malloc( *pi_result ); uint8_t *p_out_buf = p_ret = malloc( *pi_result );
if( !p_out_buf ) if( !p_out_buf )
{
*pi_result = 0;
return NULL; return NULL;
}
p_buf += 5; p_buf += 5;
......
...@@ -77,7 +77,10 @@ uint8_t * hevc_hvcC_to_AnnexB_NAL( const uint8_t *p_buf, size_t i_buf, ...@@ -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_ret;
uint8_t *p_out_buf = p_ret = malloc( *pi_result ); uint8_t *p_out_buf = p_ret = malloc( *pi_result );
if( !p_out_buf ) if( !p_out_buf )
{
*pi_result = 0;
return NULL; return NULL;
}
const uint8_t i_num_array = p_buf[22]; const uint8_t i_num_array = p_buf[22];
p_buf += 23; 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