Validate pulse position and error out if an invalid position is encountered.

Patch by Alex Converse (alex converse gmail com)

Originally committed as revision 15340 to svn://svn.ffmpeg.org/ffmpeg/trunk
