diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 90510de99e..92a29a3b15 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1027,7 +1027,7 @@ static int mpegts_push_data(MpegTSFilter *filter, } break; case MPEGTS_PAYLOAD: - if (buf_size > 0) { + if (buf_size > 0 && pes->buffer) { if (pes->data_index+buf_size > pes->total_size) { new_pes_packet(pes, ts->pkt); pes->total_size = MAX_PES_PAYLOAD;