avcodec/cbs_av1: Make overread check more robust