tgsi_to_nir: free disk cache value if the size is wrong

Fixes: 4db880d805 ("ttn: Implement disk cache")
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30308>
(cherry picked from commit 11bc95934f)
This commit is contained in:
Dylan Baker 2024-07-22 14:47:04 -07:00 committed by Eric Engestrom
parent 9c3d3f0e55
commit 271b6d1cf6
2 changed files with 2 additions and 1 deletions

View file

@ -304,7 +304,7 @@
"description": "tgsi_to_nir: free disk cache value if the size is wrong",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "4db880d8057bac3209c196edc94c6b1e521a782a",
"notes": null

View file

@ -2600,6 +2600,7 @@ load_nir_from_disk_cache(struct disk_cache *cache,
* However we do still check if the first element is indeed the size,
* as we cannot fully trust disk_cache_get (EGL_ANDROID_blob_cache) */
if (buffer[0] != size) {
free(buffer);
return NULL;
}