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

Commit 45703849 authored by Andreas Gampe's avatar Andreas Gampe Committed by Joey Rizzoli
Browse files

Aapt2: Fix png leak

do9Patch is leaking two rows of data.

Bug: 37782695
Test: ASAN_OPTIONS= SANITIZE_HOST=address m
Change-Id: Ibd2198919cd9c24f2de9f50b23c87753f2190708
parent f35e01c1
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -1080,6 +1080,10 @@ static bool do9Patch(PngInfo* image, std::string* outError) {
        newRows[i] = image->rows[i + 1];
        newRows[i] = image->rows[i + 1];
        memmove(newRows[i], newRows[i] + 4, (W - 2) * 4);
        memmove(newRows[i], newRows[i] + 4, (W - 2) * 4);
    }
    }
    delete[] image->rows[0];
    if (H - 1 > 0) {
      delete[] image->rows[H - 1];
    }
    image->rows.swap(newRows);
    image->rows.swap(newRows);


    image->width -= 2;
    image->width -= 2;