From 96515370e6fc38832c5e9e610f733f717766f2ad Mon Sep 17 00:00:00 2001 From: srowen Date: Tue, 9 Feb 2010 09:22:33 +0000 Subject: [PATCH] Issue 344-related -- avoid NPE when previewFormatString is null git-svn-id: http://zxing.googlecode.com/svn/trunk@1205 59b500cc-1b3d-0410-9834-0bbf25fbcc57 --- .../src/com/google/zxing/client/android/CameraManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/android/src/com/google/zxing/client/android/CameraManager.java b/android/src/com/google/zxing/client/android/CameraManager.java index 0a70eab7..3eebd0c0 100755 --- a/android/src/com/google/zxing/client/android/CameraManager.java +++ b/android/src/com/google/zxing/client/android/CameraManager.java @@ -287,8 +287,6 @@ final class CameraManager { // This is the standard Android format which all devices are REQUIRED to support. // In theory, it's the only one we should ever care about. case PixelFormat.YCbCr_420_SP: - return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top, - rect.width(), rect.height()); // This format has never been seen in the wild, but is compatible as we only care // about the Y channel, so allow it. case PixelFormat.YCbCr_422_SP: @@ -297,7 +295,7 @@ final class CameraManager { default: // The Samsung Moment incorrectly uses this variant instead of the 'sp' version. // Fortunately, it too has all the Y data up front, so we can read it. - if (previewFormatString.equals("yuv420p")) { + if ("yuv420p".equals(previewFormatString)) { return new PlanarYUVLuminanceSource(data, width, height, rect.left, rect.top, rect.width(), rect.height()); } -- 2.20.1