The best defense here is to be prepared. Get a second rechargeable battery, if available, as well as an AC adapter, if not already included with your camera. Then use the adapter whenever possible, especially when transferring images to your computer or viewing them with the LCD screen. If USB is not possible either because your computer or camera lacks it, you can still speed your transfers by buying a card reader. Finally, once you have made your decision and bought your camera, the first thing you should do after getting it home is to check it for bad pixels.
Digital cameras use light-sensitive chips to capture their images.
A bad pixel in the chip can result in bad pixels in your image, which usually show up as permanently white pixels in the pictures. Then look at the picture in your image editing software. If it is, then the pixel is bad and you should consider returning the camera. If your camera has a bad pixel, you can, of course, simply use your image editing software to fix the problem. So all is not lost, particularly if you have a program that automates such tasks.