summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2013-09-26 16:43:55 +0200
committerMichael Niedermayer <michaelni@gmx.at>2013-09-26 16:43:55 +0200
commit5dc6c0ea9ee7836df039c71259c7e538d7058243 (patch)
tree9e620151dc0e3973804b46c1457954b28f6dd1da
parente02495372240ad826a8a6b2ecb035bf001b64344 (diff)
avformat/mpegts: check avio_tell() return code before using it
Fixes Ticket2962 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavformat/mpegts.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 37bb5d8d82..67e94fb39e 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) {