If the user accidentally cuts an aerial photo, surprisingly they might get a sane looking section (hopefully the numbers will make it obvious it is wrong), but it will generally take a long time to not find a channel i.e. QGIS appears to freeze.
Some improvements we could do:
Only list single band rasters. But I don't like this because at least theoretically someone might have a multiband raster with an elevation band. Although, I haven't done any testing around this, or even looked at the code - does it just work with the first band?
Look at the styling of the layer to try to detect a typical RGB image and exclude it. This sounds too complicated.
Allow the user to interrupt and cancel the search for a channel. Seems like a great idea.
Do some sanity checking on the values. This might prevent a user deliberately calculating super deep flows (capacity of the Grand Canyon perhaps?).
Another option in recent QGIS versions would be to check if the raster is configured as an elevation layer, but IMO it is desirable to be able to use rasters that aren't.
If the user accidentally cuts an aerial photo, surprisingly they might get a sane looking section (hopefully the numbers will make it obvious it is wrong), but it will generally take a long time to not find a channel i.e. QGIS appears to freeze.
Some improvements we could do: