Skip to content

Commit

Permalink
avformat/pva: Check for EOF before retrying in read_part_of_packet()
Browse files Browse the repository at this point in the history
Fixes: Infinite loop
Fixes: pva-4b1835dbc2027bf3c567005dcc78e85199240d06

Found-by: Paul Ch <paulcher@icloud.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
  • Loading branch information
michaelni committed Jul 5, 2018
1 parent a7e032a commit 9807d39
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libavformat/pva.c
Expand Up @@ -134,6 +134,10 @@ static int read_part_of_packet(AVFormatContext *s, int64_t *pts,
pes_flags = avio_rb16(pb); pes_flags = avio_rb16(pb);
pes_header_data_length = avio_r8(pb); pes_header_data_length = avio_r8(pb);


if (avio_feof(pb)) {
return AVERROR_EOF;
}

if (pes_signal != 1 || pes_header_data_length == 0) { if (pes_signal != 1 || pes_header_data_length == 0) {
pva_log(s, AV_LOG_WARNING, "expected non empty signaled PES packet, " pva_log(s, AV_LOG_WARNING, "expected non empty signaled PES packet, "
"trying to recover\n"); "trying to recover\n");
Expand Down

1 comment on commit 9807d39

@wqazzz
Copy link

@wqazzz wqazzz commented on 9807d39 May 23, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.