Commit d436ea95 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

qedit: Use offsetof for the size of a struct with a varlen array.

parent 183bd439
......@@ -46,7 +46,7 @@ typedef struct _PE_Impl {
LONG refCount;
ULONG numPins;
ULONG index;
IPin *pins[0];
IPin *pins[1];
} PE_Impl;
......@@ -174,7 +174,7 @@ static const IEnumPinsVtbl IEnumPins_VTable =
static IEnumPins *pinsenum_create(IBaseFilter *filter, IPin **pins, ULONG pinCount)
{
PE_Impl *obj;
ULONG len = sizeof(PE_Impl) + (pinCount * sizeof(IPin *));
ULONG len = offsetof(PE_Impl, pins[pinCount]);
ULONG i;
obj = CoTaskMemAlloc(len);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment