Skip to content

Commit

Permalink
Validate video descriptor before checking still picture bit.
Browse files Browse the repository at this point in the history
Check to ensure that the first descriptor is a video_stream descriptor
(value 0x02) before parsing its contents. I have four test samples,
only one of which contains a video_stream descriptor in the PMT. The
others contain a system clock descriptor (0x11), a maximum bitrate
descriptor(0x14), and a private descriptor(0x86).  Test cases for all
four samples will be forthcoming.

This code still only handles the first descriptor of possibly multiple
stream descriptors. This code still needs to be updated to scan
through all the possible descriptors.
  • Loading branch information
linuxdude42 committed Nov 18, 2022
1 parent 20bb5e0 commit 092ddc0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions mythtv/libs/libmythtv/mpeg/mpegtables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ bool ProgramMapTable::IsStillPicture(const QString& sistandard) const
if (IsVideo(i, sistandard))
{
return StreamInfoLength(i) > 2 &&
(StreamInfo(i)[0] == DescriptorID::video_stream) &&
((StreamInfo(i)[2] & kStillPictureFlag) != 0);
}
}
Expand Down

0 comments on commit 092ddc0

Please sign in to comment.