This isn’t really in our area of expertise (identifying insects). That said, you can hire a pesticide person to gas the wood with methyl bromide or, you can kiln dry it with a finishing temperature of 160 degrees for a few hours.

If the wood will fit in your oven, you can do this KILN thing at home. Just place it in the oven and then set is at 170 (since most ovens only go down to 170). Keep it in there for 3 hours. That should kill the little critters. If not check your area to see where the folks who cut down timber take their wood to be kiln-dried and have them do it for you. I hope they (the worms) were creative and give your piece some character… Good luck!