ensure that default_get_buffer() doesnt reuse images if the dimension or
pix_fmt changed
fixes heap overflow, possibly exploitable

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