Commit 0afab3b6 authored by Abylay Ospan's avatar Abylay Ospan Committed by François Cartegnie

codec: atsc_a65: avoid crash

Pointer to allocated memory incremented in cycle and then used to
'free' call. This cause crash because pointer is not pointing to
originally allocated memory.
Signed-off-by: François Cartegnie's avatarFrancois Cartegnie <fcvlcdev@free.fr>
parent 3affe2e6
......@@ -95,7 +95,9 @@ static char *enlarge_to16( const uint8_t *p_src, size_t i_src, uint8_t i_prefix
if( i_src == 0 )
return NULL;
char *psz_new = malloc( i_src * 2 + 1 );
char *psz_new_allocated = malloc( i_src * 2 + 1 );
char *psz_new = psz_new_allocated;
if( psz_new )
{
memset( psz_new, i_prefix, i_src * 2 );
......@@ -107,7 +109,7 @@ static char *enlarge_to16( const uint8_t *p_src, size_t i_src, uint8_t i_prefix
psz_new += 2;
}
}
return psz_new;
return psz_new_allocated;
}
static bool convert_encoding_set( atsc_a65_handle_t *p_handle,
......
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