Merge pull request #4 from tmatth/alloc_fixes

Fix some memory allocation issues
pull/5/head
Kieran Kunhya 2014-07-11 20:02:44 +01:00
commit ae5c255cc2
2 zmienionych plików z 4 dodań i 3 usunięć

Wyświetl plik

@ -31,7 +31,7 @@ int ts_setup_hdmv_lpcm_stream( ts_writer_t *w, int pid, int num_channels, int sa
return -1;
}
stream->lpcm_ctx = calloc( 1, sizeof(stream->lpcm_ctx) );
stream->lpcm_ctx = calloc( 1, sizeof(*stream->lpcm_ctx) );
if( !stream->lpcm_ctx )
return -1;
@ -44,7 +44,7 @@ int ts_setup_hdmv_lpcm_stream( ts_writer_t *w, int pid, int num_channels, int sa
int ts_setup_dtcp( ts_writer_t *w, uint8_t byte_1, uint8_t byte_2 )
{
w->dtcp_ctx = calloc( 1, sizeof(w->dtcp_ctx) );
w->dtcp_ctx = calloc( 1, sizeof(*w->dtcp_ctx) );
if( !w->dtcp_ctx )
return -1;

Wyświetl plik

@ -985,6 +985,7 @@ int ts_setup_transport_stream( ts_writer_t *w, ts_main_t *params )
if( !cur_stream->stream_type )
{
fprintf( stderr, "Unsupported Stream Format\n" );
free( cur_stream );
return -1;
}
@ -1532,7 +1533,7 @@ int ts_write_frames( ts_writer_t *w, ts_frame_t *frames, int num_frames, uint8_t
if( num_frames )
{
ts_int_pes_t **tmp = realloc( w->buffered_frames, (w->num_buffered_frames+num_frames) * sizeof(w->buffered_frames) );
ts_int_pes_t **tmp = realloc( w->buffered_frames, (w->num_buffered_frames+num_frames) * sizeof(w->buffered_frames[0]) );
if( !tmp )
{
fprintf( stderr, "Malloc failed\n" );