correct content size from buffer