mirror of
https://github.com/mpv-player/mpv.git
synced 2024-09-20 03:52:22 +02:00
vo_x11: don't rely on XFree to free calloc-ed data
This commit is contained in:
parent
fa7503989f
commit
b616a6cef1
@ -153,8 +153,13 @@ static void freeMyXImage(struct priv *p, int foo)
|
||||
XDestroyImage(p->myximage[foo]);
|
||||
shmdt(p->Shminfo[foo].shmaddr);
|
||||
} else {
|
||||
if (p->myximage[foo])
|
||||
if (p->myximage[foo]) {
|
||||
// XDestroyImage() would free the data too since XFree() just calls
|
||||
// free(), but do it ourselves for portability reasons
|
||||
free(p->myximage[foo]->data);
|
||||
p->myximage[foo]->data = NULL;
|
||||
XDestroyImage(p->myximage[foo]);
|
||||
}
|
||||
}
|
||||
p->myximage[foo] = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user