Files
ffmpeg/libavcodec
Aidan MacDonald a0c6ae2831 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>
(cherry picked from commit a4405cc0cc)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
2026-06-21 02:56:27 +02:00
..
2025-12-03 20:26:49 +01:00
2023-11-10 00:25:38 +01:00
2022-07-07 21:52:52 +02:00
2025-08-04 16:35:29 +02:00
2022-06-24 15:37:23 +08:00
2022-06-24 15:37:23 +08:00
2026-05-05 15:21:03 +02:00
2022-05-08 10:38:54 +08:00
2025-12-03 20:26:49 +01:00
2026-05-05 16:03:30 +02:00
2025-12-03 20:26:49 +01:00
2022-07-09 20:06:47 +02:00
2025-12-03 20:26:49 +01:00
2025-08-14 00:20:30 +02:00
2025-12-03 20:26:49 +01:00
2025-08-04 16:44:27 +02:00
2024-06-13 11:22:10 +02:00
2025-11-23 04:32:17 +01:00
2025-08-14 00:20:33 +02:00
2025-08-04 16:36:05 +02:00
2025-12-03 20:26:49 +01:00
2022-07-12 21:55:22 +02:00
2023-02-22 00:32:19 +01:00
2025-08-04 16:35:47 +02:00
2025-12-03 20:26:49 +01:00
2022-06-25 09:05:58 +08:00
2026-06-21 02:56:27 +02:00
2025-08-04 16:44:26 +02:00
2025-12-03 20:26:49 +01:00
2024-07-21 22:14:11 +02:00
2026-05-05 15:21:06 +02:00
2025-08-04 16:36:12 +02:00
2026-05-05 15:21:10 +02:00
2025-08-04 16:44:26 +02:00
2022-06-16 10:23:30 +02:00
2022-07-03 15:16:31 +02:00
2025-08-13 22:05:48 +02:00
2025-12-03 20:26:49 +01:00
2026-05-05 15:21:17 +02:00
2023-10-30 00:39:00 +01:00
2022-07-03 15:16:31 +02:00
2022-07-03 15:16:31 +02:00
2025-11-23 04:32:14 +01:00
2025-08-14 00:20:32 +02:00
2023-02-22 00:10:15 +01:00
2025-08-04 16:35:28 +02:00
2025-12-03 20:26:49 +01:00
2025-08-04 16:36:07 +02:00
2023-02-21 23:53:32 +01:00
2023-10-30 00:38:57 +01:00
2022-04-10 20:12:23 +02:00
2022-04-13 00:37:06 +02:00
2022-06-25 09:05:58 +08:00
2022-07-13 00:27:37 +02:00
2026-05-05 15:21:07 +02:00
2024-06-13 19:44:50 +02:00
2025-08-04 16:35:44 +02:00
2022-07-12 21:55:22 +02:00
2025-08-04 16:35:35 +02:00
2026-05-05 15:21:12 +02:00