aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-07-03 22:14:42 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-07-16 19:16:13 +0200
commit9bb3047060c33e93ace258634aa89ee1705ec0c3 (patch)
tree532fec0c6b637ed9f8a111908fa056033ea610aa
parent34654d41d4bd9abb3b848477a6dd0a7d33816d4e (diff)
downloadffmpeg-9bb3047060c33e93ace258634aa89ee1705ec0c3.tar.gz
avformat/pva: Check for EOF before retrying in read_part_of_packet()
Fixes: Infinite loop Fixes: pva-4b1835dbc2027bf3c567005dcc78e85199240d06 Found-by: Paul Ch <paulcher@icloud.com> Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 9807d3976be0e92e4ece3b4b1701be894cd7c2e1) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/pva.c4
1 files changed, 4 insertions, 0 deletions
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");