• Timothy B. Terriberry's avatar
    Fix a possible divide-by-zero. · 7546679c
    Timothy B. Terriberry authored
    We were attempting to ensure a minimum spacing between granule
     positions when guessing the start of a link location.
    However, we took a strictly-positive granule position, added a
     fixed increment with op_granpos_add(), and checked if
     op_granpos_add() failed.
    op_granpos_add() only fails if the sum would have overflowed past
     zero, which can never happen when adding two strictly positive
     granule positions.
    Instead, we need to check if the result becomes negative (which is
     a legal granule position, but violates our assumptions in the
     search).
    
    Thanks to Felicia Lim for the report.
    7546679c
opusfile.c 126 KB