Tiny NPE fix

git-svn-id: https://zxing.googlecode.com/svn/trunk@1352 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
srowen 2010-05-11 11:44:18 +00:00
parent 74c8744e8c
commit 0e0bed8b50

View file

@ -282,8 +282,11 @@ public final class DecodeServlet extends HttpServlet {
response.sendRedirect("badimage.jspx");
return;
}
if (image == null ||
image.getHeight() <= 1 || image.getWidth() <= 1 ||
if (image == null) {
response.sendRedirect("badimage.jspx");
return;
}
if (image.getHeight() <= 1 || image.getWidth() <= 1 ||
image.getHeight() * image.getWidth() > MAX_PIXELS) {
log.fine("Dimensions too large: " + image.getWidth() + 'x' + image.getHeight());
response.sendRedirect("badimage.jspx");