From cc4ac14d514a05ba5526b96c3f6a4730f330a96a Mon Sep 17 00:00:00 2001 From: Niklas Haas Date: Fri, 26 Nov 2021 19:59:26 +0100 Subject: vo_gpu_next: guard sentinel in free_dr_buf As noticed in #9526, apparently there's some case in which DR buffers get corrupted. Add an explicit sentinel check to try and figure out which cases these are. --- video/out/vo_gpu_next.c | 1 + 1 file changed, 1 insertion(+) diff --git a/video/out/vo_gpu_next.c b/video/out/vo_gpu_next.c index 803d418b4a..be42f95164 100644 --- a/video/out/vo_gpu_next.c +++ b/video/out/vo_gpu_next.c @@ -165,6 +165,7 @@ static pl_buf get_dr_buf(struct mp_image *mpi) static void free_dr_buf(void *opaque, uint8_t *data) { struct dr_buf *dr = opaque; + assert(memcmp(dr->sentinel, dr_magic, sizeof(dr_magic)) == 0); // Can't use `&dr->buf` because it gets freed during `pl_buf_destroy` pl_buf_destroy(dr->gpu, &(pl_buf) { dr->buf }); } -- cgit v1.2.3