diff options
author | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-06 14:57:38 +0200 |
---|---|---|
committer | Andreas Rheinhardt <andreas.rheinhardt@outlook.com> | 2022-04-11 19:19:50 +0200 |
commit | cf3f8ab9e67b005e13ddbbc2315bf0aaddd5374b (patch) | |
tree | 16726d6f6ac1377ef8e3014ba7948de72b4081e2 /COPYING.LGPLv2.1 | |
parent | e254af31549ce6b4964936b3fe2124c3a18e69f8 (diff) | |
download | ffmpeg-cf3f8ab9e67b005e13ddbbc2315bf0aaddd5374b.tar.gz |
avcodec/hevc_sei: Fix parsing SEI messages
SEI messages are naturally byte-aligned by adding padding bits
to achieve byte-alignment. The parsing code in libavcodec/hevc_sei.c
nevertheless uses a GetBitContext to read it. When doing so, parsing
the next SEI message starts exactly at the position where reading
the last message (if any) ended.
This means that one would have to handle both the payload extension data
(which makes most SEI messages extensible structs) as well as the
padding bits for byte-alignment. Yet our SEI parsing code in
libavcodec/hevc_sei.c does not read these at all. Instead several of
the functions used for parsing specific SEI messages use
skip_bits_long(); some don't use it at all, in which case it is possible
for the GetBitContext to not be byte-aligned at the start of the next
SEI message (the parsing code for several types of SEI messages relies
on byte-alignment).
Fix this by always using a dedicated GetBitContext per SEI message;
skipping the necessary amount of bytes in the NALU context
is done at a higher level. This also allows to remove unnecessary
parsing code that only existed in order to skip enough bytes.
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
Diffstat (limited to 'COPYING.LGPLv2.1')
0 files changed, 0 insertions, 0 deletions