On 6/16/22 01:58, RĂ©mi Bernon (@rbernon) wrote:
diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index ae8a2d4d0c7..eb46982fabf 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -47,6 +47,11 @@ struct sample
union {
struct
{
void *__pad[3];
BYTE buffer[];
} raw; struct { IMFSample *sample;
Why the padding?
So that buffer is aligned to the end of the structure and so that we can safely use a flexible array member. Otherwise offsetof buffer[size] may be shorter than the struct, ending up with a undefined behavior when accessing a partially allocated structure and an eventual GCC warning.
Okay, that seems like a reasonable workaround; can you please add a comment so it's clear?