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.
Steve Watts posted a new article, Pokemon X & Y bug corrupts saves, Nintendo working on fix.
Pokemon has acknowledged a save game bug in Pokemon X and Y, and the Japanese company site says it is working on a fix to hit that region in a few days.