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

Commit 1968201b authored by Dan Sandler's avatar Dan Sandler
Browse files

Don't crash when drawing zero pixels.

Bug: 16561522
Change-Id: Ia3a2d2930abc393dbe587053f598246c49c0c9c4
parent 1a0449eb
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -188,6 +188,12 @@ public class VectorDrawable extends Drawable {
    public void draw(Canvas canvas) {
        final int saveCount = canvas.save();
        final Rect bounds = getBounds();

        if (bounds.width() == 0 || bounds.height() == 0) {
            // too small to draw
            return;
        }

        final boolean needMirroring = needMirroring();

        canvas.translate(bounds.left, bounds.top);