Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1330)

Unified Diff: content/browser/renderer_host/compositor_impl_android.cc

Issue 14017019: browser: Fix null ANativeWindow reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/compositor_impl_android.cc
diff --git a/content/browser/renderer_host/compositor_impl_android.cc b/content/browser/renderer_host/compositor_impl_android.cc
index 78d6834a5ed77ad6b162d679dc31ab91d1cb29bd..b1578fdd5a942b041f3482c24be7a94ca7036bfd 100644
--- a/content/browser/renderer_host/compositor_impl_android.cc
+++ b/content/browser/renderer_host/compositor_impl_android.cc
@@ -163,8 +163,10 @@ void CompositorImpl::SetWindowSurface(ANativeWindow* window) {
void CompositorImpl::SetSurface(jobject surface) {
JNIEnv* env = base::android::AttachCurrentThread();
base::android::ScopedJavaLocalRef<jobject> j_surface(env, surface);
- if (surface) {
- ANativeWindow* window = ANativeWindow_fromSurface(env, surface);
+ ANativeWindow* window = NULL;
+ if (surface)
+ window = ANativeWindow_fromSurface(env, surface);
+ if (window) {
SetWindowSurface(window);
ANativeWindow_release(window);
{
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698