Nah, that would just be checking if they're JPEGs. I need to test the integrity, decode the JPEG.
That got me thinking, what about using a module like imagemagick or something to try to decode and get the error report if they have it?
Got something surefire of the top of your head?
Comment on Re^2: Testing JPEGs for validity (windows)
Well, imagemagick also requires libjpeg, and so does any other tool that goes through full decoding. If I were you, I'd just apply the patch with _setjmp above to the needed tools.