Division by zero in opus_demo
While fuzzing opus compression I get a lot of crashes like that:
katmacadapc% ~/afl-1.94b/opus-1.1.1/.libs-notrap/opus_demo -e voip 48000 2 8000 -cbr -bandwidth NB -complexity 0 -forcemono id:000000,sig:04,src:000020,op:havoc,rep:32 /tmp/1
libopus 0.9.14
Encoding 48000 Hz input at 8.000 kb/s in narrowband with 960-sample frames.
average bitrate: 8.000 kb/s
maximum bitrate: 8.000 kb/s
src/opus_demo.c:869:43: runtime error: division by zero
SUMMARY: AddressSanitizer: undefined-behavior src/opus_demo.c:869:43 in
active bitrate: -nan kb/s
bitrate standard deviation: 0.000 kb/s
I have found it on many files, the smallest one is a single byte 0x80.
BTW, notice the print: libopus 0.9.14