Fix crash when max_ref_frames was out of range.
This might have been exploitable.
Fixes first crash of issue840.

backport r18388 by michael


Originally committed as revision 21757 to svn://svn.ffmpeg.org/ffmpeg/branches/0.5
1 file changed