From 37ec7330b4eff1da0f756fc9ac966d25cbc0fce7 Mon Sep 17 00:00:00 2001 From: magjed Date: Wed, 5 Aug 2015 00:33:40 -0700 Subject: [PATCH] VideoCapturerAndroid: Check if data is null in onPreviewFrame() onPreviewFrame() might be called with a null data pointer, which is allowed according to the documentation. BUG=webrtc:4877 Review URL: https://codereview.webrtc.org/1260183004 Cr-Commit-Position: refs/heads/master@{#9674} --- talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java b/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java index d1e45701b3..25ed3f7b76 100644 --- a/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java +++ b/talk/app/webrtc/java/src/org/webrtc/VideoCapturerAndroid.java @@ -910,7 +910,7 @@ public class VideoCapturerAndroid extends VideoCapturer implements PreviewCallba // Frames might be posted to |onPreviewFrame| with the previous format while changing // capture format in |startPreviewOnCameraThread|. Drop these old frames. Log.w(TAG, "Received callback buffer from previous configuration with length: " - + data.length); + + (data == null ? "null" : data.length)); return false; } if (buffer.capacity() != frameSize) {