fix(draw/gles/sdl): add null checks to texture cache comparison (#9770)

This commit is contained in:
Malte Nilges
2026-02-26 13:34:42 +01:00
committed by GitHub
parent 77edacfb47
commit ec053a0d94
2 changed files with 12 additions and 0 deletions

View File

@@ -163,6 +163,12 @@ static lv_cache_compare_res_t opengles_texture_cache_compare_cb(const cache_data
return lhs->h > rhs->h ? 1 : -1;
}
if(lhs->draw_dsc == NULL || rhs->draw_dsc == NULL) {
if(lhs->draw_dsc == rhs->draw_dsc) return 0;
if(lhs->draw_dsc == NULL) return -1;
return 1;
}
uint32_t lhs_dsc_size = lhs->draw_dsc->dsc_size;
uint32_t rhs_dsc_size = rhs->draw_dsc->dsc_size;

View File

@@ -92,6 +92,12 @@ static lv_cache_compare_res_t sdl_texture_cache_compare_cb(const cache_data_t *
return lhs->h > rhs->h ? 1 : -1;
}
if(lhs->draw_dsc == NULL || rhs->draw_dsc == NULL) {
if(lhs->draw_dsc == rhs->draw_dsc) return 0;
if(lhs->draw_dsc == NULL) return -1;
return 1;
}
uint32_t lhs_dsc_size = lhs->draw_dsc->dsc_size;
uint32_t rhs_dsc_size = rhs->draw_dsc->dsc_size;