If a codec can't come up with a worse SSIM value than JPEG can, then just report the worst the codec can do. No need to fail.