mirror of
https://github.com/mpv-player/mpv
synced 2025-02-22 07:46:55 +00:00
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. |
||
---|---|---|
.. | ||
context.c | ||
hwdec_d3d11va.c | ||
hwdec_dxva2dxgi.c | ||
ra_d3d11.c | ||
ra_d3d11.h |