kopia lustrzana https://github.com/kierank/libmpegts
fix some memory allocation issues
rodzic
324953eae2
commit
8be5e5b7cb
|
@ -31,7 +31,7 @@ int ts_setup_hdmv_lpcm_stream( ts_writer_t *w, int pid, int num_channels, int sa
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
stream->lpcm_ctx = calloc( 1, sizeof(stream->lpcm_ctx) );
|
stream->lpcm_ctx = calloc( 1, sizeof(*stream->lpcm_ctx) );
|
||||||
if( !stream->lpcm_ctx )
|
if( !stream->lpcm_ctx )
|
||||||
return -1;
|
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 )
|
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 )
|
if( !w->dtcp_ctx )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
|
|
@ -1532,7 +1532,7 @@ int ts_write_frames( ts_writer_t *w, ts_frame_t *frames, int num_frames, uint8_t
|
||||||
|
|
||||||
if( num_frames )
|
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 )
|
if( !tmp )
|
||||||
{
|
{
|
||||||
fprintf( stderr, "Malloc failed\n" );
|
fprintf( stderr, "Malloc failed\n" );
|
||||||
|
|
Ładowanie…
Reference in New Issue