fix some memory allocation issues

pull/4/head
Tristan Matthews 2014-07-11 14:49:55 -04:00
rodzic 324953eae2
commit 8be5e5b7cb
2 zmienionych plików z 3 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

@ -1532,7 +1532,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" );