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

Commit f70a7e34 authored by Romain Guy's avatar Romain Guy
Browse files

Fix possible crash when texture is NULL in the drop shadow cache.

Change-Id: I2142c55dbcfebcdf013a7f4ae04b266a60f5ce8a
parent 9e10841c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -74,10 +74,10 @@ void TextDropShadowCache::setMaxSize(uint32_t maxSize) {
///////////////////////////////////////////////////////////////////////////////

void TextDropShadowCache::operator()(ShadowText& text, ShadowTexture*& texture) {
    if (texture) {
        const uint32_t size = texture->width * texture->height;
        mSize -= size;

    if (texture) {
        glDeleteTextures(1, &texture->id);
        delete texture;
    }