diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/ImageWallpaper.java | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java index 9a4179f4fef5..5a3601314fd0 100644 --- a/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java +++ b/packages/SystemUI/src/com/android/systemui/ImageWallpaper.java @@ -603,7 +603,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"); |