diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-09-26 16:43:55 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-09-26 16:43:55 +0200 |
commit | 5dc6c0ea9ee7836df039c71259c7e538d7058243 (patch) | |
tree | 9e620151dc0e3973804b46c1457954b28f6dd1da /libavformat | |
parent | e02495372240ad826a8a6b2ecb035bf001b64344 (diff) | |
download | ffmpeg-streaming-5dc6c0ea9ee7836df039c71259c7e538d7058243.zip ffmpeg-streaming-5dc6c0ea9ee7836df039c71259c7e538d7058243.tar.gz |
avformat/mpegts: check avio_tell() return code before using it
Fixes Ticket2962
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/mpegts.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c index 37bb5d8..67e94fb 100644 --- a/libavformat/mpegts.c +++ b/libavformat/mpegts.c @@ -1862,8 +1862,10 @@ static int handle_packet(MpegTSContext *ts, const uint8_t *packet) return 0; pos = avio_tell(ts->stream->pb); - av_assert0(pos >= TS_PACKET_SIZE); - ts->pos47_full = pos - TS_PACKET_SIZE; + if (pos >= 0) { + av_assert0(pos >= TS_PACKET_SIZE); + ts->pos47_full = pos - TS_PACKET_SIZE; + } if (tss->type == MPEGTS_SECTION) { if (is_start) { |