[FFmpeg-cvslog] avformat/mpegts: check avio_tell() return code before using it

Michael Niedermayer git at videolan.org
Thu Sep 26 17:53:16 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Sep 26 16:43:55 2013 +0200| [5dc6c0ea9ee7836df039c71259c7e538d7058243] | committer: Michael Niedermayer

avformat/mpegts: check avio_tell() return code before using it

Fixes Ticket2962

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=5dc6c0ea9ee7836df039c71259c7e538d7058243
---

 libavformat/mpegts.c |    6 ++++--
 1 file 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) {



More information about the ffmpeg-cvslog mailing list