Add buffer alignment validation in createSubBuffer