adxenc: check output buffer size before writing