Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5f89f510 authored by Jack Palevich's avatar Jack Palevich
Browse files

Throw an exception when trying to upload a recycled bitmap.

Previously we would upload garbage.

Change-Id: Id785792a16f9d24685687f4e6b64ec893ccad225
parent 944170f2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -142,6 +142,9 @@ public final class GLUtils {
        if (bitmap == null) {
            throw new NullPointerException("texImage2D can't be used with a null Bitmap");
        }
        if (bitmap.isRecycled()) {
            throw new IllegalArgumentException("bitmap is recycled");
        }
        if (native_texImage2D(target, level, -1, bitmap, -1, border)!=0) {
            throw new IllegalArgumentException("invalid Bitmap format");
        }