Sony's de facto flagship right now is the Xperia Z3+ (AKA the Xperia Z4 in some regions). It runs a Snapdragon 810 processor, which has gained a reputation for running hot. Sony's camera software isn't doing anything to prove that assumption wrong. Watch in the video below as the camera app crashes in a few seconds because of high temperatures.
The video uses Sony's bizarre augmented reality camera mode, but apparently the same thing happens when you try to shoot 4K video or even just take too many photos. The phone pops up a notice that the camera has to close because of high temperatures, but it allegedly saves the recording. Trying to launch the camera after playing a game can cause the camera to instantly crash too.
Sony is aware of the issue and is supposed to be working on a software fix. Although, it's not like this is an unplanned hard crash. Sony knew the camera app could cause the device to overheat, otherwise the warning messages wouldn't be there. This might just be a quirk of the design.