fixes issue 2127. Patch by Daniel Kang, daniel.d.kang at gmail Originally committed as revision 26204 to svn://svn.ffmpeg.org/ffmpeg/trunk