OSDN Git Service

Merge tag 'android-8.1.0_r81' into oreo-x86
[android-x86/frameworks-base.git] / packages / SystemUI / src / com / android / systemui / ImageWallpaper.java
index 104321a..b6e9ec7 100644 (file)
@@ -606,7 +606,16 @@ public class ImageWallpaper extends WallpaperService {
 
             final FloatBuffer triangleVertices = createMesh(left, top, right, bottom);
 
-            final int texture = loadTexture(mBackground);
+            int texture = 0;
+            try {
+                texture = loadTexture(mBackground);
+            } catch (IllegalArgumentException e) {
+                mEgl.eglMakeCurrent(mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
+                mEgl.eglDestroySurface(mEglDisplay, mEglSurface);
+                mEgl.eglDestroyContext(mEglDisplay, mEglContext);
+                mEgl.eglTerminate(mEglDisplay);
+                return false;
+            }
             final int program = buildProgram(sSimpleVS, sSimpleFS);
 
             final int attribPosition = glGetAttribLocation(program, "position");