diff options
author | Niklas Haas <git@haasn.dev> | 2021-11-26 19:59:26 +0100 |
---|---|---|
committer | Niklas Haas <git@haasn.dev> | 2021-11-26 19:59:26 +0100 |
commit | cc4ac14d514a05ba5526b96c3f6a4730f330a96a (patch) | |
tree | 330122d3de888050216b77857bf0a8793e25e7c6 /video/out | |
parent | 059bd3dcaa3af087cf3722a8fa81128433cbb1dc (diff) | |
download | mpv-cc4ac14d514a05ba5526b96c3f6a4730f330a96a.tar.bz2 mpv-cc4ac14d514a05ba5526b96c3f6a4730f330a96a.tar.xz |
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.
Diffstat (limited to 'video/out')
-rw-r--r-- | video/out/vo_gpu_next.c | 1 |
1 files changed, 1 insertions, 0 deletions
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 }); } |