add minimum buffer size

to make sure there is macroblock size length left at the end of the buffer when the targeted buffer size is small