mmap_read_frame() takes care of ensuring that the packet size is correct. Originally committed as revision 20855 to svn://svn.ffmpeg.org/ffmpeg/trunk