• Anton Khirnov's avatar
    lavc/bitstream: avoid UB in bits_{read,peek}_signed(0) · 0b33310c
    Anton Khirnov authored
    bits_*_signed(0) will currently invoke an undefined shift by
    8 * sizeof(int).
    
    Add bits_*_signed_nz() that only works for n>0, analogous to
    bits_read_nz(). Add an explicit check for n=0 in bits_*_signed().
    
    Found-by: James Almer
    0b33310c
bitstream.h 6.93 KB