All foods go bad. For chocolate the white film is a definitive sign it is heading there. The white film, like most things with chocolate, has a beautiful term to describe it. In the culinary world it is referred to as “bloom” and happens when you improperly store the chocolate. Cook’s Illustrated says warmness and condensation are the biggest culprits.
“Improper storage of chocolate can cause a superficial white film, called a bloom, to develop. There are two types: Cocoa butter bloom occurs when the chocolate softens so much that the cocoa butter crystals melt and molecules of fat migrate to the surface where they form new crystals. Sugar bloom happens when water condenses on the chocolate and dissolves some of its sugar. When that water evaporates, a fine layer of sugar crystals is left behind.”
Just because it bloomed doesn’t mean you need to throw it away. Give some new life by baking with it. Check out their article for more info.