diff options
author | Aidan MacDonald <aidanmacdonald.0x0@gmail.com> | 2022-09-30 15:20:09 +0100 |
---|---|---|
committer | Anton Khirnov <anton@khirnov.net> | 2022-11-16 08:41:14 +0100 |
commit | a4405cc0cc16413fe5222c888b3d4bb04cedc83f (patch) | |
tree | 9c8fbdf33e859d836acca7a9a267b032eeacae34 /libavfilter | |
parent | b119b3da1e772bcf152f487d6e39cbeea17d8f50 (diff) | |
download | ffmpeg-a4405cc0cc16413fe5222c888b3d4bb04cedc83f.tar.gz |
avcodec/dvdsub_parser: Fix length check for short packets
The DVD subtitle parser handles two types of packets: "normal"
packets with a 16-bit length, and HD-DVD packets that set the
16-bit length to 0 and encode a 32-bit length in the next four
bytes. This implies that HD-DVD packets are at least six bytes
long, but the code didn't actually verify this.
The faulty length check results in an out of bounds read for
zero-length "normal" packets that occur in the input, which are
only 2 bytes long, but get misinterpreted as an HD-DVD packet.
When this happens the parser reads packet_len from beyond the
end of the input buffer. The subtitle stream is not correctly
decoded after this point due to the garbage packet_len.
Fixing this is pretty simple: fix the length check so packets
less than 6 bytes long will not be mistakenly parsed as HD-DVD
packets.
Signed-off-by: Aidan MacDonald <aidanmacdonald.0x0@gmail.com>
Signed-off-by: Anton Khirnov <anton@khirnov.net>
Diffstat (limited to 'libavfilter')
0 files changed, 0 insertions, 0 deletions