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

Commit f126e21f authored by Philip P. Moltmann's avatar Philip P. Moltmann
Browse files

Handle bitmap==null in PdfRenderer.Page#render.

Change-Id: Ie24ca45d4b5e27d5e99de72115e8e00b32b30655
parent 939efb2f
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ import android.graphics.Rect;
import android.os.ParcelFileDescriptor;
import android.system.ErrnoException;
import android.system.OsConstants;
import com.android.internal.util.Preconditions;
import dalvik.system.CloseGuard;
import libcore.io.Libcore;

@@ -375,6 +376,8 @@ public final class PdfRenderer implements AutoCloseable {
                           @Nullable Matrix transform, @RenderMode int renderMode) {
            throwIfClosed();

            destination = Preconditions.checkNotNull(destination, "bitmap null");

            if (destination.getConfig() != Config.ARGB_8888) {
                throw new IllegalArgumentException("Unsupported pixel format");
            }