Decoder crash with new error pattern (which starts with a lost frame)
In !2046 (merged), new error patterns were added. One of them (scripts/dly_error_profiles/ep_5pct.g192) causes the decoder to crash. The most prominent change is that the new pattern starts with a lost frame.
Reproduce with:
git checkout ci/fix-error-patterns-for-correct-error-percentage
make clean
make -j
./IVAS_cod -stereo 48000 48 scripts/testv/stvST48c.wav bit
eid-xor bit scripts/dly_error_profiles/ep_5pct.g192 bit_err
./IVAS_dec stereo 48 bit_err out.wav
This causes a segfault. Msan revealst that it is a null pointer access in lib_dec.c:
MemorySanitizer:DEADLYSIGNAL
==128213==ERROR: MemorySanitizer: SEGV on unknown address 0x0000000000ac (pc 0x0000004e0b41 bp 0x7ffdd1f6fa20 sp 0x7ffdd1f6f890 T128213)
==128213==The signal is caused by a READ memory access.
==128213==Hint: address points to the zero page.
#0 0x4e0b41 in IVAS_DEC_Setup /local/knj/ivas-codec/lib_dec/lib_dec.c:1988:61
#1 0x4dd52d in IVAS_DEC_GetSamplesDecoder /local/knj/ivas-codec/lib_dec/lib_dec.c:1100:24
#2 0x4bcc83 in decodeG192 /local/knj/ivas-codec/apps/decoder.c:2415:32
#3 0x4a4bfe in main /local/knj/ivas-codec/apps/decoder.c:763:17
#4 0x7f3930925249 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#5 0x7f3930925304 in __libc_start_main csu/../csu/libc-start.c:360:3
#6 0x421530 in _start (/local/knj/ivas-codec/IVAS_dec+0x421530)
MemorySanitizer can not provide additional info.
SUMMARY: MemorySanitizer: SEGV /local/knj/ivas-codec/lib_dec/lib_dec.c:1988:61 in IVAS_DEC_Setup