You've already forked FFmpeg
mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2026-04-24 04:44:54 +02:00
e90c2ff4b5
The US country_code path in parse_itut_t35_metadata() reads the the provider_code with bytestream2_get_be16u(), which is a unchecked version that does not validate the remaining length before reading. When an AV1 stream contains ITU-T T.35 metadata with country_code set to 0xB5 (which is US) and a payload shorter than 2 bytes, this results in a heap overflow reading 2 bytes past the allocation. The UK country code already guards against this issue by checking it before the unchecked read. We're using the same pattern to the US country code path. Pwno crafted an AV1 IVF with a metadata OBU containing ITU-T T.35 with country_code=0xB5 and a 1-byte payload. Decoding with libdav1d triggers the overflow. ASan says: ERROR: AddressSanitizer: heap-buffer-overflow READ of size 2 at 0x5020000003f0 thread T0 #0 bytestream_get_be16 src/libavcodec/bytestream.h:98 #1 bytestream2_get_be16u src/libavcodec/bytestream.h:98 #2 parse_itut_t35_metadata src/libavcodec/libdav1d.c:376 0x5020000003f1 is located 0 bytes after 1-byte region Found-by: Pwno