[FFmpeg-cvslog] check return value of url_fseek in mpegts_get_pcr

elupus git at videolan.org
Wed Sep 14 17:19:58 CEST 2011


ffmpeg | branch: master | elupus <elupus at ecce.se> | Wed Aug 27 20:07:51 2008 +0200| [0a90b6a43e76aec8031b6c8a46bba2bf6cd25fa7] | committer: Michael Niedermayer

check return value of url_fseek in mpegts_get_pcr

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

 libavformat/mpegts.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libavformat/mpegts.c b/libavformat/mpegts.c
index 34f1c96..011868e 100644
--- a/libavformat/mpegts.c
+++ b/libavformat/mpegts.c
@@ -1720,7 +1720,8 @@ static int64_t mpegts_get_pcr(AVFormatContext *s, int stream_index,
     int pcr_l, pcr_pid = ((PESContext*)s->streams[stream_index]->priv_data)->pcr_pid;
     pos = ((*ppos  + ts->raw_packet_size - 1 - ts->pos47) / ts->raw_packet_size) * ts->raw_packet_size + ts->pos47;
         while(pos < pos_limit) {
-            avio_seek(s->pb, pos, SEEK_SET);
+            if (avio_seek(s->pb, pos, SEEK_SET) < 0)
+                return AV_NOPTS_VALUE;
             if (avio_read(s->pb, buf, TS_PACKET_SIZE) != TS_PACKET_SIZE)
                 return AV_NOPTS_VALUE;
             if ((pcr_pid < 0 || (AV_RB16(buf + 1) & 0x1fff) == pcr_pid) &&



More information about the ffmpeg-cvslog mailing list