Some time ago I discovered a small number of corrupted JPG files on my hard drive. They were all JPGs derived from my Canon EOS 40D raw files (but not from Lightroom). This was a case of "silent" corruption - the files could be backed up and copied without problem. I did not know they were corrupted until I opened them and saw crazy colors.
The raw files were not corrupted. I have not found any corruption since, which is a good sign.
However, I started to wonder what other files might be corrupt on my system, and whether there was some nefarious process going on in my computer. So I looked for a general utility to scan my data files (I use Windows) to detect corruption. But there doesn't seem to be such a utility.
But recently I came across the program "Bad Peggy" which is at least able to scan many photo files (including JPG, JPEG, GIF, etc but not raw files) and check them for corruption. I ran the prog on my files and it seemed to work well. It quickly found the corrupted JPGs mentioned earlier. It also flagged all native JPGs from my Sony RX100 as "not a JPEG file". (They look fine, though.) A small number of JPGs from my phone had some benign errors.
So overall, after scanning over 10,000 jpgs, I infer that my other files are probably also OK and conclude my system is healthy.
Some of you might find Bad Peggy useful. There is a free trial.