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.
This commit is contained in:
Niklas Haas 2021-11-26 19:59:26 +01:00
parent 059bd3dcaa
commit cc4ac14d51
1 changed files with 1 additions and 0 deletions

View File

@ -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 });
}