From cd9c459642989ceb3ebfbda4b9d3b0fbc38c07ff Mon Sep 17 00:00:00 2001 From: Jean-Paul Saman Date: Tue, 12 Jan 2021 20:05:00 +0100 Subject: [PATCH] write_pmt: table can span multiple packets, use the correct data to write --- libmpegts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libmpegts.c b/libmpegts.c index 828799b..8539306 100644 --- a/libmpegts.c +++ b/libmpegts.c @@ -630,14 +630,13 @@ static int write_pmt( ts_writer_t *w, ts_int_program_t *program ) bs_init( &z, program->pmt_packets[program->num_queued_pmt], 188 ); write_packet_header( w, &z, 0, program->pmt.pid, PAYLOAD_ONLY, &program->pmt.cc ); - write_bytes( &z, &temp[pos], MIN( bytes_left, length ) ); + write_bytes( &z, &pmt_buf[pos], MIN( bytes_left, length ) ); bs_flush( &z ); write_padding( &z, 0 ); pos += MIN( bytes_left, length ); length -= MIN( bytes_left, length ); program->num_queued_pmt++; } - return 0; }