Nintendo has acknowledged a bug in Pokemon X and Y that can corrupt save files, and is currently working on a fix for the problem. The patch is said to be coming to the eShop in Japan within a few days, so it will likely hit North America soon too.
The Nintendo Japan site (via Polygon) also made a map of where the bug appears (above). The bug corrupts files if you save your game within the blue highlighted area, which composes the main outer ring of Lumiose City. As long as you save elsewhere for the time being, you and your Pokemon should be fine.