You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-08-15 14:13:16 +02:00
mpegts: Pad the packet buffer in handle_packet().
This allows it to be used with get_bits without the thread of overreads. Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org
This commit is contained in:
@@ -1772,7 +1772,7 @@ static int read_packet(AVFormatContext *s, uint8_t *buf, int raw_packet_size)
|
|||||||
static int handle_packets(MpegTSContext *ts, int nb_packets)
|
static int handle_packets(MpegTSContext *ts, int nb_packets)
|
||||||
{
|
{
|
||||||
AVFormatContext *s = ts->stream;
|
AVFormatContext *s = ts->stream;
|
||||||
uint8_t packet[TS_PACKET_SIZE];
|
uint8_t packet[TS_PACKET_SIZE+FF_INPUT_BUFFER_PADDING_SIZE];
|
||||||
int packet_num, ret = 0;
|
int packet_num, ret = 0;
|
||||||
|
|
||||||
if (avio_tell(s->pb) != ts->last_pos) {
|
if (avio_tell(s->pb) != ts->last_pos) {
|
||||||
@@ -1794,6 +1794,7 @@ static int handle_packets(MpegTSContext *ts, int nb_packets)
|
|||||||
|
|
||||||
ts->stop_parse = 0;
|
ts->stop_parse = 0;
|
||||||
packet_num = 0;
|
packet_num = 0;
|
||||||
|
memset(packet + TS_PACKET_SIZE, 0, FF_INPUT_BUFFER_PADDING_SIZE);
|
||||||
for(;;) {
|
for(;;) {
|
||||||
if (ts->stop_parse>0)
|
if (ts->stop_parse>0)
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user