Esme Povirk (@madewokherd) commented about dlls/gdiplus/metafile.c:
if ((status = GdipCreateCustomLineCap(fill_path, stroke_path, line_cap_data->BaseCap,
line_cap_data->BaseInset, &line_cap)))
goto default_cap_failed;
if ((status = GdipSetCustomLineCapStrokeCaps(line_cap, line_cap_data->StrokeStartCap, line_cap_data->StrokeEndCap)))
goto default_cap_failed;
if ((status = GdipSetCustomLineCapStrokeJoin(line_cap, line_cap_data->StrokeJoin)))
goto default_cap_failed;
if ((status = GdipSetCustomLineCapWidthScale(line_cap, line_cap_data->WidthScale)))
goto default_cap_failed;
GdipDeletePath(path);
*cap = line_cap;
return Ok;
- default_cap_failed:
if (line_cap)
line_cap should be null-initialized. I don't think it's possible for GdipCreateCustomLineCap to return an error to this function without setting the result to NULL, but it shouldn't rely on that.