There is always a risk to using wood, any wood really. Yet my tanks are full of chunks of wood.
You want to be sure it is hardwood, that it is thoroughly dead and dry throughout (the larger the thickness the longer this takes). Then you want to do what you can to ensure it has never been exposed to toxins like oil, gas, pesticides, fertilizers, etc. Collecting from a watercourse adds possible issues with pathogens that might kill aquarium fish. Some of these things may be removed with extensive boiling, but some cannot.
Never put any wood you intend to use in a fish tank in contact with any liquid but water. Wood absorbs liquids, and they may leech out months later.