check num_reorder_frames for validity
increase delayed_pic buffer size (one temporary is used and a terminating NULL is assumed by most code so it has to be 18 large)

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