From f17ad792c675d2e953cdecf81b8fb0c03ef71690 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kacper=20Michaj=C5=82ow?= Date: Fri, 10 May 2024 21:15:34 +0200 Subject: [PATCH] vo_gpu_next: check if existing cache file has correct size --- video/out/vo_gpu_next.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 73111a5d1c..67f7d5833a 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -1650,7 +1650,8 @@ static void cache_save_obj(void *p, pl_cache_obj obj) } // Don't save if already exists - if (!stat(filepath, &(struct stat){0})) { + struct stat st; + if (!stat(filepath, &st) && st.st_size == obj.size) { MP_DBG(c, "%s: key(%"PRIx64"), size(%zu)\n", __func__, obj.key, obj.size); goto done; }