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

Submitted by Lance.Gao on April 15, 2019, 8:15 a.m.

Details

Message ID 1555316150-7192-1-git-send-email-bweaglegao@126.com
State New
Headers show

Commit Message

Lance.Gao April 15, 2019, 8:15 a.m.
Signed-off-by: Lance.Gao <bweaglegao@126.com>
---
 libavformat/flvdec.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Michael Niedermayer April 15, 2019, 9:53 p.m.
On Mon, Apr 15, 2019 at 04:15:50PM +0800, Lance.Gao wrote:
> Signed-off-by: Lance.Gao <bweaglegao@126.com>
> ---
>  libavformat/flvdec.c | 2 ++
>  1 file changed, 2 insertions(+)

"fix the problem of packet mismatch while reading rtmp stream"

this is too vague, its not clear what problem this is about, or how this
fixes it



[...]

Patch hide | download patch | download mbox

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);