[FFmpeg-devel] [PATCH v1] avformat/flvdec: fix the problem of packet mismatch while reading rtmp stream

Lance.Gao bweaglegao at 126.com
Mon Apr 15 11:15:50 EEST 2019


Signed-off-by: Lance.Gao <bweaglegao at 126.com>
---
 libavformat/flvdec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/flvdec.c b/libavformat/flvdec.c
index b531a39..bc63dd2 100644
--- a/libavformat/flvdec.c
+++ b/libavformat/flvdec.c
@@ -1003,6 +1003,8 @@ static int flv_read_packet(AVFormatContext *s, AVPacket *pkt)
     int orig_size;
 
 retry:
+    if (avio_feof(s->pb))
+        return AVERROR_EOF;
     /* pkt size is repeated at end. skip it */
     pos  = avio_tell(s->pb);
     type = (avio_r8(s->pb) & 0x1F);
-- 
2.7.4



More information about the ffmpeg-devel mailing list