As others pointed out, the piece you cite has a "pick up measure". Note though that it is not categorically ok for measures to not add up to the number of beats in the time signature, it can only happen at the first measure.
In pieces that start over again, the last measure before jumping back to the pick up measure that starts the piece should also be partial so that the number of counts in both partial measures add up to the full number of beats.
There is another case where you can have an apparent mismatch in the number of notes and the time signature. This happens if the measure has "grace notes". Grace notes "don't count" - they don't add to the total duration for that measure.