Reallocate internal buffer when coded frame size changes.
Fixes out-of-bounds reads and writes with i32/smclocki32.avi.1.0 from issue 1240.

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