oss-fuzz: heap-buffer-overflow on address 0x606000000060
reproduce with ./build-asan/tests/dav1d_fuzzer clusterfuzz-testcase-minimized-dav1d_fuzzer-5712491695308800
clusterfuzz-testcase-minimized-dav1d_fuzzer-5712491695308800
Error parsing OBU data
=================================================================
==16445==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x606000000060 at pc 0x7f589858cb17 bp 0x7ffc44b25490 sp 0x7ffc44b25480
READ of size 1 at 0x606000000060 thread T0
#0 0x7f589858cb16 in dav1d_loopfilter_sbrow_16bpc ../src/lf_apply.c:185
#1 0x7f58985ae493 in dav1d_filter_sbrow_16bpc ../src/recon.c:1459
#2 0x7f5898501cd6 in dav1d_decode_frame ../src/decode.c:2669
#3 0x7f5898505157 in dav1d_submit_frame ../src/decode.c:3036
#4 0x7f58984d08cd in dav1d_parse_obus ../src/obu.c:1088
#5 0x7f58985b02e7 in dav1d_decode ../src/lib.c:201
#6 0x558632a86f6d in LLVMFuzzerTestOneInput ../tests/libfuzzer/dav1d_fuzzer.c:82
#7 0x558632a8673f in main ../tests/libfuzzer/main.c:87
#8 0x7f5897edcae6 in __libc_start_main (/lib64/libc.so.6+0x21ae6)
#9 0x558632a86969 in _start (/home/janne/src/dav1d/build-asan/tests/dav1d_fuzzer+0x1969)
0x606000000060 is located 0 bytes to the right of 64-byte region [0x606000000020,0x606000000060) allocated by thread T0 here:
#0 0x7f589890bd30 in malloc (/usr/lib/gcc/x86_64-pc-linux-gnu/7.3.0/libasan.so.4+0xded30)
#1 0x7f58984ff97b in dav1d_decode_frame ../src/decode.c:2510
SUMMARY: AddressSanitizer: heap-buffer-overflow ../src/lf_apply.c:185 in dav1d_loopfilter_sbrow_16bpc
Shadow bytes around the buggy address:
0x0c0c7fff7fb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0c7fff7fc0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0c7fff7fd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0c7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0c7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0c0c7fff8000: fa fa fa fa 00 00 00 00 00 00 00 00[fa]fa fa fa
0x0c0c7fff8010: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0c7fff8020: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0c7fff8030: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0c7fff8040: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x0c0c7fff8050: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==16445==ABORTING