[FFmpeg-cvslog] avformat/pva: Check for EOF before retrying in read_part_of_packet()

Michael Niedermayer git at videolan.org
Mon Jul 16 20:03:49 EEST 2018


ffmpeg | branch: release/4.0 | Michael Niedermayer <michael at niedermayer.cc> | Tue Jul  3 22:14:42 2018 +0200| [6f4b82cc3a879f5d3f9a4738bfd7d93757221958] | committer: Michael Niedermayer

avformat/pva: Check for EOF before retrying in read_part_of_packet()

Fixes: Infinite loop
Fixes: pva-4b1835dbc2027bf3c567005dcc78e85199240d06

Found-by: Paul Ch <paulcher at icloud.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 9807d3976be0e92e4ece3b4b1701be894cd7c2e1)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

 libavformat/pva.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavformat/pva.c b/libavformat/pva.c
index 16381db905..04ae8e2800 100644
--- a/libavformat/pva.c
+++ b/libavformat/pva.c
@@ -134,6 +134,10 @@ recover:
             pes_flags              = avio_rb16(pb);
             pes_header_data_length = avio_r8(pb);
 
+            if (avio_feof(pb)) {
+                return AVERROR_EOF;
+            }
+
             if (pes_signal != 1 || pes_header_data_length == 0) {
                 pva_log(s, AV_LOG_WARNING, "expected non empty signaled PES packet, "
                                           "trying to recover\n");



More information about the ffmpeg-cvslog mailing list