Itseez/opencv — pull request #3314 by lurkingrobbert (2014-10-08 07:51:34+00:00)
Title: Process libjpeg errors the OpenCV way

Errors from libjpeg, specifically "Corrupted JPEG data" messages, are printed to `stderr` by the default error handler, making those errors uncatchable. By overwriting the `output_message` method as suggested by the libjpeg docs we can handle those errors like regular OpenCV errors.