fixes segfault / issue491 Originally committed as revision 13767 to svn://svn.ffmpeg.org/ffmpeg/trunk