Are there any risks to flashing a ROM? Are there any risks to manually flashing a stock or custom ROM?


Does it have the potential to brick the device?
Will it void my warranty?
Will I stop getting updates?
Anything else I should be aware of?


(See also: Are there any risks to rooting a device?)
Adapted from Are there any risks to rooting a device?

Does it have the potential to brick the device?  

Yes.  Flashing bad software is the easiest way to brick your device.  A failed flash or one that gets interrupted may also brick your device.  Sometimes things just go wrong even if you do everything right; flashing software manually is not something for the faint of heart.

Some devices are easy to "soft brick" but difficult to "hard brick".  A soft brick is when the device fails to boot and you need to resort to flashing firmware, often through a manufacturer tool like Samsung's Odin, to fix it.  A hard brick is when it's totally broken; this usually only occurs if you overwrite the device's bootloader.

Will it void my warranty? 

If you flash a custom ROM, you void your warranty.  If you flash a stock ROM over top of an "unaltered" (e.g., never rooted) stock ROM through the manufacturer-approved process, then you should be safe, but flashing stock under other circumstances is no different from flashing a custom ROM.

Will I stop getting updates?

For stock ROMs, no, not in general.  You won't get stock updates for a custom ROM, but the custom ROM might have its own updates.

Can I go back to the stock ROM if I'm unhappy with the custom one?

Generally, yes. Most guides you'll find strongly recommend backing up your stock ROM when your phone is in recovery mode before you actually flash the new ROM. From recovery, you should be able to restore your stock ROM in all its glory should something go wrong during the flashing (but you can still boot in recovery mode) or if you are dissatisfied with your current ROM. Finding the right stock ROM for your device online is going to be much harder after the fact (and it might be hard to be sure it hasn't been tampered with), so be sure to do this before doing anything else.

Anything else?

Custom ROMs will frequently provide features that the original software did not.  However, it is also often the case that not all hardware may be supported on your specific device.  Modified versions of the original ROMs are more likely to be fully compatible than something like CyanogenMod.  (Although, of course, there are cases where CM has fixed issues that the original manufacturer did not!)