wined3d: Avoid sizeof on structs with variable length arrays.

Michael Stefaniuc mstefani at redhat.com
Wed Jun 13 06:27:19 CDT 2012


On 06/13/2012 12:56 PM, Henri Verbeet wrote:
> On 13 June 2012 10:41, Michael Stefaniuc <mstefani at redhat.de> wrote:
>> -    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object));
>> +    object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, FIELD_OFFSET(struct wined3d, adapters[1]));
> 
> That's not really a VLA, just a somewhat stupid array of size 1.
Uh... Any reason that field cannot be just
 struct wined3d_adapter adapter;
?

bye
	michael



More information about the wine-devel mailing list