aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Converse <alex.converse@gmail.com>2012-03-02 10:12:11 -0800
committerReinhard Tartler <siretart@tauware.de>2012-03-04 21:26:29 +0100
commitb7c8fff80351249d448b93608bfac832c1ee3b4b (patch)
tree0687a7de188e5250779c76d4eb813f6b4f0180d5
parent3f7e90cf0c12d739c5b9cd548c1916f23d691185 (diff)
downloadffmpeg-b7c8fff80351249d448b93608bfac832c1ee3b4b.tar.gz
mpegts: Do not call read_sl_header() when no bytes remain in the buffer.
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind CC: libav-stable@libav.org (cherry picked from commit 4df369692ea8aee7094ac0f233cef8d1bee139a3) Signed-off-by: Reinhard Tartler <siretart@tauware.de>
-rw-r--r--libavformat/mpegts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 85e09527e3..cc36e656da 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -889,7 +889,7 @@ static int mpegts_push_data(MpegTSFilter *filter,
/* we got the full header. We parse it and get the payload */
pes->state = MPEGTS_PAYLOAD;
pes->data_index = 0;
- if (pes->stream_type == 0x12) {
+ if (pes->stream_type == 0x12 && buf_size > 0) {
int sl_header_bytes = read_sl_header(pes, &pes->sl, p, buf_size);
pes->pes_header_size += sl_header_bytes;
p += sl_header_bytes;