diff options
author | James Ross-Gowan <rossy@jrg.systems> | 2019-08-19 23:54:46 +1000 |
---|---|---|
committer | James Ross-Gowan <rossy@jrg.systems> | 2019-08-20 18:12:21 +1000 |
commit | 80552ab28ed7fb2edca995af81dd143422e6b7a3 (patch) | |
tree | 1d03d84267ac63252013e4d6a53bc24d15bf3c0b /video/out/vulkan | |
parent | cd7bcb9d0c12ee4e252024235cc8bbb395960118 (diff) | |
download | mpv-80552ab28ed7fb2edca995af81dd143422e6b7a3.tar.bz2 mpv-80552ab28ed7fb2edca995af81dd143422e6b7a3.tar.xz |
vo_gpu: d3d11: fix storage lifetime of compound literals
Somehow I got the idea that compound literals had function-scoped
lifetime. Instead, like all other objects with automatic storage
duration, compound literals are block-scoped, so they become invalid
after exiting the block they were declared in. It seems like a recent
change to GCC actually reuses the memory that the compound literals
used to occupy, which was causing a few bugs.
The pattern of conditionally assigning a pointer to a compound literal
was used in a few places in ra_d3d11 where the Direct3D API expects
either a pointer to an initialised struct or NULL. Change these to
ensure the lifetime of the struct includes the API call.
Should fix #6775.
Diffstat (limited to 'video/out/vulkan')
0 files changed, 0 insertions, 0 deletions