mirror of
https://github.com/zxing/zxing.git
synced 2024-11-10 04:54:04 -08:00
Watch for CMMException
git-svn-id: https://zxing.googlecode.com/svn/trunk@1307 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
aacdce8d7e
commit
612581ce71
|
@ -56,6 +56,7 @@ import org.apache.http.params.BasicHttpParams;
|
|||
import org.apache.http.params.HttpParams;
|
||||
import org.apache.http.params.HttpProtocolParams;
|
||||
|
||||
import java.awt.color.CMMException;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
@ -250,7 +251,17 @@ public final class DecodeServlet extends HttpServlet {
|
|||
private static void processStream(InputStream is, ServletRequest request,
|
||||
HttpServletResponse response) throws ServletException, IOException {
|
||||
|
||||
BufferedImage image = ImageIO.read(is);
|
||||
BufferedImage image;
|
||||
try {
|
||||
image = ImageIO.read(is);
|
||||
} catch (IOException ioe) {
|
||||
response.sendRedirect("badimage.jspx");
|
||||
return;
|
||||
} catch (CMMException cmme) {
|
||||
// Have seen this in logs
|
||||
response.sendRedirect("badimage.jspx");
|
||||
return;
|
||||
}
|
||||
if (image == null) {
|
||||
response.sendRedirect("badimage.jspx");
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue