mirror of
https://github.com/mpv-player/mpv
synced 2025-01-07 07:30:09 +00:00
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:
parent
059bd3dcaa
commit
cc4ac14d51
@ -165,6 +165,7 @@ static pl_buf get_dr_buf(struct mp_image *mpi)
|
|||||||
static void free_dr_buf(void *opaque, uint8_t *data)
|
static void free_dr_buf(void *opaque, uint8_t *data)
|
||||||
{
|
{
|
||||||
struct dr_buf *dr = opaque;
|
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`
|
// Can't use `&dr->buf` because it gets freed during `pl_buf_destroy`
|
||||||
pl_buf_destroy(dr->gpu, &(pl_buf) { dr->buf });
|
pl_buf_destroy(dr->gpu, &(pl_buf) { dr->buf });
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user